Skip to content

Commit

Permalink
Generate metadata!
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker committed Jul 24, 2023
1 parent 0f2dff5 commit 8abe6b6
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/docker.yml
Expand Up @@ -5,8 +5,13 @@ on:
- dev
- beta
- stable
- docker_publish
workflow_dispatch:
tags:
- '*'
pull_request:
branches:
- dev
- beta
- stable
jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -18,8 +23,10 @@ jobs:
images: |
pwntools/pwntools
tags: |
# branch event
type=ref,event=branch
type=ref,event=pr
type=pep440,pattern={{version}}
type=raw,value=latest,enable={{is_default_branch}}
# Required for subdirectories in Git context
- name: Set up Docker Buildx
Expand All @@ -33,40 +40,44 @@ jobs:

- name: Build and push base image
uses: docker/build-push-action@v4
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/heads/dev'))
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/dev')
with:
context: "{{defaultContext}}:extra/docker/base"
push: ${{ github.event_name != 'pull_request' }}
tags: peacemakerdev/pwntools:base
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' && startsWith(github.ref, 'refs/heads/stable'))
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/stable')
with:
context: "{{defaultContext}}:extra/docker/stable"
push: ${{ github.event_name != 'pull_request' }}
tags: pwntools/pwntools:stable
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' && startsWith(github.ref, 'refs/heads/beta'))
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/beta')
with:
context: "{{defaultContext}}:extra/docker/beta"
push: ${{ github.event_name != 'pull_request' }}
tags: pwntools/pwntools:beta
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' && startsWith(github.ref, 'refs/heads/dev'))
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/dev')
with:
context: "{{defaultContext}}:extra/docker/dev"
push: ${{ github.event_name != 'pull_request' }}
tags: pwntools/pwntools:dev
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' && startsWith(github.ref, 'refs/heads/dev'))
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads/dev')
with:
context: "{{defaultContext}}:travis/docker"
push: ${{ github.event_name != 'pull_request' }}
tags: pwntools/pwntools:ci
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 8abe6b6

Please sign in to comment.