|
1 |
| -name: Build for Release |
2 |
| -on: [release] |
| 1 | +name: Publish containers for release |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
3 | 6 |
|
4 | 7 | jobs:
|
5 |
| - release-linux-386: |
6 |
| - name: release linux/386 |
7 |
| - runs-on: ubuntu-latest |
8 |
| - steps: |
9 |
| - - uses: actions/checkout@master |
10 |
| - - name: compile and release |
11 |
| - uses: ngs/go-release.action@v1.0.1 |
12 |
| - env: |
13 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
14 |
| - GOARCH: '386' |
15 |
| - GOOS: linux |
16 |
| - EXTRA_FILES: 'license' |
17 |
| - release-linux-amd64: |
18 |
| - name: release linux/amd64 |
19 |
| - runs-on: ubuntu-latest |
20 |
| - steps: |
21 |
| - - uses: actions/checkout@master |
22 |
| - - name: compile and release |
23 |
| - uses: ngs/go-release.action@v1.0.1 |
24 |
| - env: |
25 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
26 |
| - GOARCH: amd64 |
27 |
| - GOOS: linux |
28 |
| - EXTRA_FILES: 'license' |
29 |
| - release-darwin-amd64: |
30 |
| - name: release darwin/amd64 |
31 |
| - runs-on: ubuntu-latest |
32 |
| - steps: |
33 |
| - - uses: actions/checkout@master |
34 |
| - - name: compile and release |
35 |
| - uses: ngs/go-release.action@v1.0.1 |
36 |
| - env: |
37 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
38 |
| - GOARCH: amd64 |
39 |
| - GOOS: darwin |
40 |
| - EXTRA_FILES: 'license' |
41 |
| - release-windows-386: |
42 |
| - name: release windows/386 |
43 |
| - runs-on: ubuntu-latest |
44 |
| - steps: |
45 |
| - - uses: actions/checkout@master |
46 |
| - - name: compile and release |
47 |
| - uses: ngs/go-release.action@v1.0.1 |
48 |
| - env: |
49 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
50 |
| - GOARCH: '386' |
51 |
| - GOOS: windows |
52 |
| - EXTRA_FILES: 'license' |
53 |
| - release-windows-amd64: |
54 |
| - name: release windows/amd64 |
55 |
| - runs-on: ubuntu-latest |
56 |
| - steps: |
57 |
| - - uses: actions/checkout@master |
58 |
| - - name: compile and release |
59 |
| - uses: ngs/go-release.action@v1.0.1 |
60 |
| - env: |
61 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
62 |
| - GOARCH: amd64 |
63 |
| - GOOS: windows |
64 |
| - EXTRA_FILES: 'license' |
65 |
| - docker: |
66 |
| - name: publish to docker |
| 8 | + push_to_registries: |
| 9 | + name: Push Docker image to multiple registries |
67 | 10 | runs-on: ubuntu-latest
|
| 11 | + permissions: |
| 12 | + packages: write |
| 13 | + contents: read |
| 14 | + attestations: write |
| 15 | + id-token: write |
68 | 16 | steps:
|
69 |
| - - uses: actions/checkout@master |
70 |
| - - name: Set up Docker Buildx |
71 |
| - uses: docker/setup-buildx-action@v2 |
72 |
| - - name: Login to Docker Hub |
73 |
| - uses: docker/login-action@v2 |
| 17 | + - name: Check out the repo |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Log in to Docker Hub |
| 21 | + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a |
| 22 | + with: |
| 23 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 24 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 25 | + |
| 26 | + - name: Log in to the Container registry |
| 27 | + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 |
| 28 | + with: |
| 29 | + registry: ghcr.io |
| 30 | + username: ${{ github.actor }} |
| 31 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + |
| 33 | + - name: Extract metadata (tags, labels) for Docker |
| 34 | + id: meta |
| 35 | + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 |
74 | 36 | with:
|
75 |
| - username: ${{ secrets.DOCKERHUB_USERNAME }} |
76 |
| - password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 37 | + images: | |
| 38 | + spacebinorg/spirit |
| 39 | + ghcr.io/${{ github.repository }} |
| 40 | +
|
77 | 41 | - name: Build and push Docker images
|
78 |
| - uses: docker/build-push-action@v3.2.0 |
| 42 | + id: push |
| 43 | + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 |
| 44 | + with: |
| 45 | + context: . |
| 46 | + push: true |
| 47 | + tags: ${{ steps.meta.outputs.tags }} |
| 48 | + labels: ${{ steps.meta.outputs.labels }} |
| 49 | + |
| 50 | + - name: Generate artifact attestation |
| 51 | + uses: actions/attest-build-provenance@v1 |
| 52 | + with: |
| 53 | + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} |
| 54 | + subject-digest: ${{ steps.push.outputs.digest }} |
| 55 | + push-to-registry: true |
0 commit comments