Skip to content

Commit

Permalink
Update github actions
Browse files Browse the repository at this point in the history
Basic github actions to build and publish container images to ghcr.
  • Loading branch information
Jasper-Ben committed Jul 27, 2023
1 parent d98c77f commit d554be1
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 85 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/docker-build.yaml
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 }}
57 changes: 0 additions & 57 deletions .github/workflows/docker-image.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/pull-request.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/run-tests.yaml
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
#
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ docker run -ti --rm \
-e AWS_DEFAULT_REGION \
-v "${HOME}/.aws:/root/.aws" \
-v "${HOME}/.kube/config:/root/.kube/config" \
ghcr.io/deinstapel/eks-rolling-update/eks-rolling-update:edge \
ghcr.io/deinstapel/eks-rolling-update:edge \
-c my-cluster
```

Expand Down

0 comments on commit d554be1

Please sign in to comment.