This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GITHUB Actions workflows to the repo
- Loading branch information
Showing
2 changed files
with
100 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,42 @@ | ||
name: Container Build Test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches-ignore: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build container | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
id: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up QEMU | ||
id: qemu | ||
if: success() | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
if: success() | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build container | ||
id: build | ||
if: success() | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: arm64 | ||
tags: ${{ github.repository }}:container-build-test-${{ github.RUN_NUMBER }} |
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,58 @@ | ||
name: Container Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: main | ||
|
||
jobs: | ||
build: | ||
name: Build container | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
id: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get Tag name | ||
id: tag | ||
if: success() | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Set up QEMU | ||
id: qemu | ||
if: success() | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: arm64 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
if: success() | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
id: login | ||
if: success() | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESSTOKEN }} | ||
|
||
- name: Push to Docker Hub | ||
id: push_dockerhub | ||
if: success() | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: arm64 | ||
push: true | ||
tags: ${{ github.repository }}:latest,${{ github.repository }}:latest,${{ github.repository }}:latest,${{ github.repository }}:${{ steps.tag.outputs.tag }} | ||
|
||
- name: Image digest Docker Hub | ||
id: digest_dockerhub | ||
if: success() | ||
run: echo ${{ steps.push_dockerhub.outputs.digest }} |