|
| 1 | +name: Build base image |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - '*' |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@v2 |
| 15 | + |
| 16 | + - name: Parse tag from ref |
| 17 | + id: vars |
| 18 | + run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} |
| 19 | + |
| 20 | + - name: Set up QEMU |
| 21 | + uses: docker/setup-qemu-action@v1 |
| 22 | + |
| 23 | + - name: Set up Docker Buildx |
| 24 | + uses: docker/setup-buildx-action@v1 |
| 25 | + |
| 26 | + - name: Login to DockerHub |
| 27 | + |
| 28 | + with: |
| 29 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 30 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 31 | + |
| 32 | + - name: Login to GHCR (GitHub Packages) |
| 33 | + |
| 34 | + with: |
| 35 | + registry: ghcr.io |
| 36 | + username: ${{ github.actor }} |
| 37 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + |
| 39 | + - name: Build opencpu/base |
| 40 | + uses: docker/build-push-action@v2 |
| 41 | + with: |
| 42 | + context: docker/base |
| 43 | + push: true |
| 44 | + tags: | |
| 45 | + opencpu/base:latest |
| 46 | + opencpu/base:${{ steps.vars.outputs.tag }} |
| 47 | + ghcr.io/${{github.repository}}/base:latest |
| 48 | +
|
| 49 | + - name: Build opencpu/rstudio |
| 50 | + uses: docker/build-push-action@v2 |
| 51 | + with: |
| 52 | + context: docker/rstudio |
| 53 | + push: true |
| 54 | + tags: | |
| 55 | + opencpu/rstudio:latest |
| 56 | + opencpu/rstudio:${{ steps.vars.outputs.tag }} |
| 57 | + ghcr.io/${{github.repository}}/rstudio:latest |
| 58 | +
|
| 59 | + - name: Build opencpu/apps |
| 60 | + uses: docker/build-push-action@v2 |
| 61 | + with: |
| 62 | + context: docker/apps |
| 63 | + push: true |
| 64 | + tags: | |
| 65 | + opencpu/apps:latest |
| 66 | + opencpu/apps:${{ steps.vars.outputs.tag }} |
| 67 | + ghcr.io/${{github.repository}}/apps:latest |
0 commit comments