forked from hellofresh/eks-rolling-update
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic github actions to build and publish container images to ghcr.
- Loading branch information
1 parent
d98c77f
commit d554be1
Showing
5 changed files
with
91 additions
and
85 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,63 @@ | ||
name: docker-build | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[0-9]+\\.[0-9]+\\.[0-9]+" | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
docker-build: | ||
name: Build and push container images | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v2 | ||
- name: Export git tag | ||
uses: tenhaus/get-release-or-tag@v2 | ||
id: tag | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
# default branch event | ||
type=edge,branch=${{ github.event.repository.default_branch }},priority=700 | ||
type=sha,format=long,branch=${{ github.event.repository.default_branch }},priority=100 | ||
# tag event | ||
type=semver,pattern={{version}},event=tag,priority=900 | ||
type=semver,pattern={{major}},event=tag,priority=850 | ||
type=semver,pattern={{major}}.{{minor}},event=tag,priority=800 | ||
type=sha,format=long,event=tag,priority=100 | ||
# pr event | ||
type=ref,event=pr,priority=600 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to ghcr.io | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
# TODO: fixme | ||
#name: "Run tests" | ||
# | ||
#on: | ||
# pull_request: | ||
# branches: | ||
# - master | ||
# | ||
#jobs: | ||
# test: | ||
# name: Run tests | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v1 | ||
# - name: Set up Python 3.7 | ||
# uses: actions/setup-python@v1 | ||
# with: | ||
# python-version: 3.7 | ||
# - name: Install dependencies | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip3 install -r requirements.txt | ||
# pip3 install -r requirements-tests.txt | ||
# - name: Run tests | ||
# run: | | ||
# make test | ||
# |
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