|
| 1 | +name: Publish Docker image to GitHub |
| 2 | +on: |
| 3 | + push: |
| 4 | + |
| 5 | +jobs: |
| 6 | + push_docker: |
| 7 | + name: Push Ubuntu Docker image to GitHub |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - name: Check out the repo |
| 11 | + uses: actions/checkout@v2 |
| 12 | + - name: Login to GitHub Container Registry |
| 13 | + uses: docker/login-action@v1 |
| 14 | + with: |
| 15 | + registry: ghcr.io |
| 16 | + username: ${{ github.repository_owner }} |
| 17 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 18 | + - name: Push to GitHub |
| 19 | + uses: docker/build-push-action@v2 |
| 20 | + with: |
| 21 | + file: ./Dockerfile.docker |
| 22 | + tags: ghcr.io/msyea/ubuntu-docker |
| 23 | + push: true |
| 24 | + push_dind: |
| 25 | + needs: push_docker |
| 26 | + name: Push Ubuntu DinD image to GitHub |
| 27 | + runs-on: ubuntu-latest |
| 28 | + steps: |
| 29 | + - name: Check out the repo |
| 30 | + uses: actions/checkout@v2 |
| 31 | + - name: Login to GitHub Container Registry |
| 32 | + uses: docker/login-action@v1 |
| 33 | + with: |
| 34 | + registry: ghcr.io |
| 35 | + username: ${{ github.repository_owner }} |
| 36 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + - name: Push to GitHub |
| 38 | + uses: docker/build-push-action@v2 |
| 39 | + with: |
| 40 | + file: ./Dockerfile.dind |
| 41 | + tags: ghcr.io/msyea/ubuntu-dind |
| 42 | + push: true |
| 43 | + build-args: REGISTRY=ghcr.io/ |
| 44 | + push_gha: |
| 45 | + needs: [push_docker, push_dind] |
| 46 | + name: Push GitHub Actions runner image to GitHub |
| 47 | + runs-on: ubuntu-latest |
| 48 | + steps: |
| 49 | + - name: Check out the repo |
| 50 | + uses: actions/checkout@v2 |
| 51 | + - name: Login to GitHub Container Registry |
| 52 | + uses: docker/login-action@v1 |
| 53 | + with: |
| 54 | + registry: ghcr.io |
| 55 | + username: ${{ github.repository_owner }} |
| 56 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + - name: Push to GitHub |
| 58 | + uses: docker/build-push-action@v2 |
| 59 | + with: |
| 60 | + tags: ghcr.io/msyea/github-actions-runner |
| 61 | + push: true |
| 62 | + build-args: REGISTRY=ghcr.io/ |
0 commit comments