diff options
Diffstat (limited to '.github/workflows/docker.yml')
-rw-r--r-- | .github/workflows/docker.yml | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..bc9b3f4 --- /dev/null +++ b/.github/workflows/docker.yml | |||
@@ -0,0 +1,51 @@ | |||
1 | name: Docker Build and Publish | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | branches: | ||
6 | - 'master' | ||
7 | |||
8 | jobs: | ||
9 | docker: | ||
10 | runs-on: ubuntu-latest | ||
11 | steps: | ||
12 | - | ||
13 | name: Checkout | ||
14 | uses: actions/checkout@v3 | ||
15 | - | ||
16 | name: Docker meta | ||
17 | id: meta | ||
18 | uses: docker/metadata-action@v3 | ||
19 | with: | ||
20 | # list of Docker images to use as base name for tags | ||
21 | images: | | ||
22 | ghcr.io/${{ github.repository }} | ||
23 | # generate Docker tags based on the following events/attributes | ||
24 | tags: | | ||
25 | type=ref,event=branch | ||
26 | type=semver,pattern={{version}} | ||
27 | - | ||
28 | name: Set up QEMU | ||
29 | uses: docker/setup-qemu-action@v1 | ||
30 | - | ||
31 | name: Set up Docker Buildx | ||
32 | uses: docker/setup-buildx-action@v1 | ||
33 | - | ||
34 | name: Login to GitHub Container Registry | ||
35 | uses: docker/login-action@v1 | ||
36 | with: | ||
37 | registry: ghcr.io | ||
38 | username: ${{ github.repository_owner }} | ||
39 | password: ${{ secrets.GITHUB_TOKEN }} | ||
40 | - | ||
41 | name: Build and push | ||
42 | uses: docker/build-push-action@v2 | ||
43 | with: | ||
44 | context: . | ||
45 | # Due to build time, only building the one currently needed. | ||
46 | # If needed, we can add more platforms when requested. | ||
47 | platforms: "linux/amd64" | ||
48 | # Push pull requests so they can be tested | ||
49 | #push: ${{ github.event_name != 'pull_request' }} | ||
50 | tags: ${{ steps.meta.outputs.tags }} | ||
51 | labels: ${{ steps.meta.outputs.labels }} | ||