|
5 | 5 | release: |
6 | 6 | types: |
7 | 7 | - created |
8 | | - schedule: |
9 | | - - cron: '00 00 * * *' |
10 | 8 |
|
11 | 9 | jobs: |
12 | 10 | docker: |
|
33 | 31 | echo IMAGE_TAG=$([ ${{ github.ref_type }} == 'tag' ] && echo ${{ github.ref_name }} || echo 'latest') >> $GITHUB_ENV |
34 | 32 |
|
35 | 33 | - name: Build and Push release to ghcr.io |
36 | | - if: github.event_name != 'schedule' |
37 | 34 | uses: docker/build-push-action@v5 |
38 | 35 | with: |
39 | 36 | context: . |
|
49 | 46 | secrets: | |
50 | 47 | "github_token=${{ secrets.GITHUB_TOKEN }}" |
51 | 48 |
|
52 | | - - name: Build and Push nightly to ghcr.io |
53 | | - if: github.event_name == 'schedule' |
54 | | - uses: docker/build-push-action@v5 |
55 | | - with: |
56 | | - context: . |
57 | | - build-args: | |
58 | | - INSTALL_ALL=true |
59 | | - platforms: linux/amd64,linux/arm64 |
60 | | - push: true |
61 | | - tags: | |
62 | | - ghcr.io/${{ github.repository }}:nightly |
63 | | - # Fix multi-platform: https://github.com/docker/buildx/issues/1533 |
64 | | - provenance: false |
65 | | - secrets: | |
66 | | - "github_token=${{ secrets.GITHUB_TOKEN }}" |
67 | | -
|
68 | 49 | - name: Login to DockerHub Container Registry |
69 | 50 | uses: docker/login-action@v4 |
70 | 51 | with: |
|
73 | 54 | password: ${{ secrets.DOCKERHUB_PASSWORD }} |
74 | 55 |
|
75 | 56 | - name: Build and Push release to DockerHub |
76 | | - if: github.event_name != 'schedule' |
77 | 57 | uses: docker/build-push-action@v5 |
78 | 58 | with: |
79 | 59 | context: . |
|
85 | 65 | registry.hub.docker.com/tofuutils/pre-commit-opentofu:${{ env.IMAGE_TAG }} |
86 | 66 | registry.hub.docker.com/tofuutils/pre-commit-opentofu:latest |
87 | 67 | provenance: false |
88 | | - |
89 | | - - name: Build and Push nightly to DockerHub |
90 | | - if: github.event_name == 'schedule' |
91 | | - uses: docker/build-push-action@v5 |
92 | | - with: |
93 | | - context: . |
94 | | - build-args: | |
95 | | - INSTALL_ALL=true |
96 | | - platforms: linux/amd64,linux/arm64 |
97 | | - push: true |
98 | | - tags: | |
99 | | - registry.hub.docker.com/tofuutils/pre-commit-opentofu:nightly |
100 | | - provenance: false |
0 commit comments