Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuild the images on push to the respective branch.
- Loading branch information
1 parent
f1d5afe
commit 1458dee
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Publish Docker images | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- beta | ||
- stable | ||
workflow_dispatch: | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: | | ||
pwntools/pwntools | ||
tags: | | ||
type=ref,event=branch | ||
# 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: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- 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: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- 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: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- 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 | ||
labels: ${{ steps.meta.outputs.labels }} |