-
-
Notifications
You must be signed in to change notification settings - Fork 52
59 lines (49 loc) · 1.95 KB
/
docker.yml
File metadata and controls
59 lines (49 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build and push Docker images
on:
push:
branches: [ dev ]
tags: [ '*' ]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Login to Docker Hub
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Declare some variables
shell: bash
run: |
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build and push stable Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
file: Dockerfile
tags: arkscript/stable:latest,arkscript/stable:${{ env.sha_short }}
# push the image only if the event that kicked off the workflow was a push of a git tah
push: ${{ startsWith(github.ref, 'refs/tags/') }}
# keep .git repository
context: .
- name: Build and push nightly Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
file: Dockerfile
tags: arkscript/nightly:latest,arkscript/nightly:${{ env.sha_short }}
# keep .git repository
context: .
- name: Build and push harden Docker image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
file: harden.dockerfile
tags: arkscript/harden:latest
push: true
# keep .git repository
context: .