aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/publish.yml
blob: ca570c925b924e62ddffc4f18287763fd79d8442 (plain)
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
name: Publish Docker Image

on:
   push:
      branches:
         - master
      tags:
         - "*"
   workflow_dispatch:

env:
   REGISTRY: ghcr.io
   IMAGE: nea89o/discordavatarproxy

permissions:
    contents: read
    packages: write

jobs:
    build:
        runs-on: ubuntu-latest
        steps:
        -   uses: actions/checkout@v4
        -   uses: docker/metadata-action@v5
            id: meta
            with:
                images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
                tags: |
                    type=ref,event=branch
                    type=semver,pattern={{version}}
                    type=semver,pattern={{major}}.{{minor}}
                    type=semver,pattern={{major}}
                    type=sha
        -   uses: docker/login-action@v3
            with:
                username: ${{ github.actor }}
                password: ${{ secrets.GITHUB_TOKEN }}
                registry: ${{ env.REGISTRY }}

        -   uses: docker/setup-buildx-action@v3
        -   uses: docker/build-push-action@v6
            with:
                context: .
                push: true
                tags: ${{ steps.meta.outputs.tags }}
                labels: ${{ steps.meta.outputs.labels }}