-
Notifications
You must be signed in to change notification settings - Fork 7
41 lines (36 loc) · 1.15 KB
/
publish-staging-docker-image.yml
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
# Push the staging Docker image (ghcr.italia/developers-italia-api:main)
# on updates to main.
on:
push:
branches: [ main ]
permissions:
# To push Docker images to GitHub
packages: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
uses: actions/setup-go@v5
with:
go-version: 1.18.x
-
uses: actions/checkout@v4
with:
# All history, required for goreleaser
fetch-depth: 0
-
# FIXME: goreleaser should already take care of the login
# (see https://github.com/goreleaser/goreleaser/blame/02a3486d4ba59505113a57b438ae567351ed3dab/scripts/entrypoint.sh#L17)
# but it doesn't work for some reason.
run: echo "$GITHUB_TOKEN" | docker login ghcr.io -u docker --password-stdin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
# Tag with a temporary valid semantic version. This is required by goreleaser.
run: git tag v0-main-$(git rev-parse --short HEAD)
-
uses: goreleaser/goreleaser-action@v6
with:
version: v1.9.2
args: release --config .goreleaser.staging.yaml