-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'features/#1-docker-login-build-push-sign-actions'
- Loading branch information
Showing
6 changed files
with
133 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,56 @@ | ||
name: CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
env: | ||
DOCKER_BUILD_ENABLED: ${{ secrets.DOCKER_BUILD_ENABLED }} | ||
DOCKER_PUSH_ENABLED: ${{ secrets.DOCKER_PUSH_ENABLED }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
services: | ||
registry: | ||
image: registry:2 | ||
ports: | ||
- 5000:5000 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to Docker registries | ||
if: github.event_name != 'pull_request' && env.DOCKER_BUILD_ENABLED == 'true' && env.DOCKER_PUSH_ENABLED == 'true' | ||
uses: ./actions/docker-multiple-login-develop | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build Docker base image | ||
id: base-image | ||
if: env.DOCKER_BUILD_ENABLED == 'true' | ||
uses: ./actions/docker-build-push-sign-develop | ||
with: | ||
meta-registries: localhost:5000/local,localhost:5000/local2 | ||
meta-image-name: base | ||
buildx-driver-opts: | | ||
network=host | ||
build-file: ./Dockerfile_base | ||
push-enabled: true | ||
|
||
- name: Build, push and sign Docker image | ||
if: env.DOCKER_BUILD_ENABLED == 'true' | ||
uses: ./actions/docker-build-push-sign-develop | ||
with: | ||
meta-image-name: test | ||
buildx-driver-opts: | | ||
network=host | ||
build-enabled: ${{ env.DOCKER_BUILD_ENABLED }} | ||
build-args: | | ||
BASE_IMAGE=localhost:5000/local/base:${{ steps.base-image.outputs.meta-version }} | ||
push-enabled: ${{ github.event_name != 'pull_request' && env.DOCKER_PUSH_ENABLED == 'true' }} | ||
cosign-key-base64: ${{ secrets.COSIGN_KEY_BASE64 }} | ||
cosign-password: ${{ secrets.COSIGN_PASSWORD }} |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
.DS_Store | ||
cosign.key |
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,5 @@ | ||
ARG BASE_IMAGE=local/base:develop | ||
|
||
FROM ${BASE_IMAGE} | ||
|
||
RUN echo "Hello world 2!" |
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,3 @@ | ||
FROM alpine | ||
|
||
RUN echo "Hello world!" |
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
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,4 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQlAr5GZ3nvtuyspUzX2H/+HCMuC9 | ||
+THi0CDCAc5zzgD/2Fjb15ZPhuBI3apsCAVYG/zq4WTJLRrdJhuD8I09bA== | ||
-----END PUBLIC KEY----- |