|
1 | 1 | name: Build and deploy |
2 | 2 | on: |
3 | | - workflow_run: |
4 | | - workflows: [Test and build] |
5 | | - types: |
6 | | - - completed |
7 | | - branches: |
8 | | - - master |
| 3 | + # workflow_run: |
| 4 | + # workflows: [Test and build] |
| 5 | + # types: |
| 6 | + # - completed |
| 7 | + # branches: |
| 8 | + # - master |
9 | 9 | workflow_dispatch: |
10 | 10 | inputs: |
11 | 11 | logLevel: |
|
24 | 24 | IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} |
25 | 25 | REGISTRY_USER: ${{ github.actor }} |
26 | 26 | jobs: |
27 | | - build-amd64-and-upload: |
28 | | - runs-on: ubuntu-latest |
29 | | - steps: |
30 | | - - name: Set up Docker Buildx |
31 | | - uses: docker/setup-buildx-action@v2 |
32 | | - - name: Login to GitHub Container Registry |
33 | | - uses: docker/login-action@v2 |
34 | | - with: |
35 | | - registry: ghcr.io |
36 | | - # Can't use self-defined environment variables for some reason |
37 | | - username: ${{ github.actor }} |
38 | | - password: ${{ secrets.DOCKER_BUILD_PUSH_TOKEN }} |
39 | | - - name: Build and push image |
40 | | - uses: docker/build-push-action@v4 |
41 | | - with: |
42 | | - push: true |
43 | | - target: release |
44 | | - tags: ghcr.io/${{ github.repository_owner }}/url_shortener:${{ github.sha }} |
45 | | - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache |
46 | | - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache,mode=max |
47 | | - platforms: linux/amd64 |
48 | | - build-arm64-and-upload: |
49 | | - runs-on: ubuntu-latest |
50 | | - steps: |
51 | | - - name: Set up QEMU |
52 | | - uses: docker/setup-qemu-action@v2 |
53 | | - with: |
54 | | - platforms: arm64 |
55 | | - - name: Set up Docker Buildx |
56 | | - uses: docker/setup-buildx-action@v2 |
57 | | - - name: Login to GitHub Container Registry |
58 | | - uses: docker/login-action@v2 |
59 | | - with: |
60 | | - registry: ghcr.io |
61 | | - # Can't use self-defined environment variables for some reason |
62 | | - username: ${{ github.actor }} |
63 | | - password: ${{ secrets.DOCKER_BUILD_PUSH_TOKEN }} |
64 | | - - name: Build and push image |
65 | | - uses: docker/build-push-action@v4 |
66 | | - with: |
67 | | - push: true |
68 | | - target: release |
69 | | - tags: ghcr.io/${{ github.repository_owner }}/url_shortener:${{ github.sha }} |
70 | | - cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache |
71 | | - cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache,mode=max |
72 | | - platforms: linux/arm64 |
| 27 | + # TODO: Build and push multi-arch docker image locally, github ci supports arm64 or a better solution is found |
| 28 | + # build-amd64-and-upload: |
| 29 | + # runs-on: ubuntu-latest |
| 30 | + # steps: |
| 31 | + # - name: Set up Docker Buildx |
| 32 | + # uses: docker/setup-buildx-action@v2 |
| 33 | + # - name: Login to GitHub Container Registry |
| 34 | + # uses: docker/login-action@v2 |
| 35 | + # with: |
| 36 | + # registry: ghcr.io |
| 37 | + # # Can't use self-defined environment variables for some reason |
| 38 | + # username: ${{ github.actor }} |
| 39 | + # password: ${{ secrets.DOCKER_BUILD_PUSH_TOKEN }} |
| 40 | + # - name: Build and push image |
| 41 | + # uses: docker/build-push-action@v4 |
| 42 | + # with: |
| 43 | + # push: true |
| 44 | + # target: release |
| 45 | + # tags: ghcr.io/${{ github.repository_owner }}/url_shortener:${{ github.sha }} |
| 46 | + # cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache |
| 47 | + # cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache,mode=max |
| 48 | + # platforms: linux/amd64 |
| 49 | + # build-arm64-and-upload: |
| 50 | + # runs-on: ubuntu-latest |
| 51 | + # steps: |
| 52 | + # - name: Set up QEMU |
| 53 | + # uses: docker/setup-qemu-action@v2 |
| 54 | + # with: |
| 55 | + # platforms: arm64 |
| 56 | + # - name: Set up Docker Buildx |
| 57 | + # uses: docker/setup-buildx-action@v2 |
| 58 | + # - name: Login to GitHub Container Registry |
| 59 | + # uses: docker/login-action@v2 |
| 60 | + # with: |
| 61 | + # registry: ghcr.io |
| 62 | + # # Can't use self-defined environment variables for some reason |
| 63 | + # username: ${{ github.actor }} |
| 64 | + # password: ${{ secrets.DOCKER_BUILD_PUSH_TOKEN }} |
| 65 | + # - name: Build and push image |
| 66 | + # uses: docker/build-push-action@v4 |
| 67 | + # with: |
| 68 | + # push: true |
| 69 | + # target: release |
| 70 | + # tags: ghcr.io/${{ github.repository_owner }}/url_shortener:${{ github.sha }} |
| 71 | + # cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache |
| 72 | + # cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/url_shortener:buildcache,mode=max |
| 73 | + # platforms: linux/arm64 |
73 | 74 | health_check: |
74 | 75 | runs-on: ubuntu-latest |
75 | | - needs: [build-amd64-and-upload, build-arm64-and-upload] |
| 76 | + # needs: [build-amd64-and-upload, build-arm64-and-upload] |
76 | 77 | steps: |
77 | 78 | - name: Check whether URL shortener is up |
78 | 79 | id: health_check |
|
0 commit comments