diff options
Diffstat (limited to '.github/workflows/docker.yml')
-rw-r--r-- | .github/workflows/docker.yml | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..7474cc4 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,64 @@ +name: Publish Docker images +on: + push: + branches: + - dev + - beta + - stable + workflow_dispatch: +jobs: + publish: + runs-on: ubuntu-latest + if: github.repository_owner == 'Gallopsled' + steps: + # Required for subdirectories in Git context + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + + - name: Build and push base image + uses: docker/build-push-action@v4 + if: github.event_name == 'workflow_dispatch' + with: + context: "{{defaultContext}}:extra/docker/base" + push: true + tags: pwntools/pwntools:base + + - name: Build and push stable image + uses: docker/build-push-action@v4 + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/stable') + with: + context: "{{defaultContext}}:extra/docker/stable" + push: true + tags: pwntools/pwntools:stable + + - name: Build and push beta image + uses: docker/build-push-action@v4 + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/beta') + with: + context: "{{defaultContext}}:extra/docker/beta" + push: true + tags: pwntools/pwntools:beta + + - name: Build and push dev image + uses: docker/build-push-action@v4 + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/dev') + with: + context: "{{defaultContext}}:extra/docker/dev" + push: true + tags: | + pwntools/pwntools:dev + pwntools/pwntools:latest + + - name: Build and push ci image + uses: docker/build-push-action@v4 + if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/dev') + with: + context: "{{defaultContext}}:travis/docker" + push: true + tags: pwntools/pwntools:ci |