|
1 | 1 | name: Build and Publish Docker |
2 | 2 |
|
3 | 3 | on: |
| 4 | + workflow_dispatch: |
4 | 5 | push: |
5 | 6 | branches: |
6 | | - - main |
| 7 | + - px2c |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + packages: write |
7 | 12 |
|
8 | 13 | jobs: |
9 | | - build_and_push: |
| 14 | + build-and-push: |
10 | 15 | runs-on: ubuntu-latest |
11 | | - env: |
12 | | - IMAGE_NAME: rep2 |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + platform: |
| 19 | + - linux/amd64 |
| 20 | + - linux/arm64 |
13 | 21 | steps: |
14 | | - - name: Checkout |
15 | | - uses: actions/checkout@v2 |
16 | | - |
17 | | - - name: Set up QEMU |
18 | | - uses: docker/setup-qemu-action@v1 |
19 | | - |
20 | | - - name: Set up Docker Buildx |
21 | | - uses: docker/setup-buildx-action@v1 |
22 | | - |
23 | | - - name: Login to DockerHub |
24 | | - uses: docker/login-action@v1 |
| 22 | + - uses: actions/checkout@v6 |
| 23 | + with: |
| 24 | + ref: 'px2c' |
| 25 | + - uses: docker/setup-qemu-action@v3 |
| 26 | + - uses: docker/setup-buildx-action@v3 |
| 27 | + - uses: docker/login-action@v3 |
25 | 28 | with: |
26 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 29 | + username: ${{ vars.DOCKERHUB_USERNAME }} |
27 | 30 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
28 | | - |
29 | | - - name: Login to GitHub Container Registry |
30 | | - uses: docker/login-action@v1 |
| 31 | + - uses: docker/login-action@v3 |
31 | 32 | with: |
32 | 33 | registry: ghcr.io |
33 | | - username: ${{ github.repository_owner }} |
34 | | - password: ${{ secrets.CR_PAT }} |
35 | | - |
36 | | - - name: Build and push |
37 | | - uses: docker/build-push-action@v2 |
| 34 | + username: ${{ github.actor }} |
| 35 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 36 | + - uses: docker/build-push-action@v6 |
38 | 37 | with: |
39 | | - context: . |
40 | 38 | platforms: linux/amd64,linux/arm64 |
41 | | - push: true |
42 | 39 | tags: | |
43 | | - ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest |
44 | | - ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest |
| 40 | + ${{ vars.DOCKERHUB_USERNAME }}/rep2:px2c |
| 41 | + ghcr.io/${{ github.actor }}/rep2:px2c |
| 42 | + push: true |
0 commit comments