-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
66 additions
and
4 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,40 @@ | ||
on: | ||
workflow_call: | ||
outputs: | ||
docker_image_tags: | ||
description: "Docker image tags" | ||
value: ${{ jobs.docker-build-and-push.outputs.docker_image_tags }} | ||
|
||
name: Publish Docker image | ||
|
||
jobs: | ||
docker-build-and-push: | ||
name: Push Docker image to Docker Hub | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Extract metadata for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: p0security/braekhus | ||
flavor: | | ||
latest=auto | ||
prefix=v,onlatest=false | ||
- name: Build and push Docker image | ||
id: docker-build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
outputs: | ||
docker_image_tags: ${{ steps.meta.outputs.tags }} |
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,24 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: {} | ||
|
||
name: Deploy | ||
|
||
# By setting the concurrency to a constant string value, | ||
# only one pipeline can run at the same time. | ||
# Pipeline from another merge will be in pending state until | ||
# the current pipeline finishes. | ||
# If yet another merge happens, the pending pipeline is cancelled. | ||
# (Only one pipeline is in pending state at any time) | ||
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency | ||
concurrency: main-deploy | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test.yaml | ||
|
||
docker: | ||
uses: ./.github/workflows/docker.yaml | ||
secrets: inherit | ||
|
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