Skip to content

Commit

Permalink
Test docker with qemu.
Browse files Browse the repository at this point in the history
  • Loading branch information
edufolly committed Feb 12, 2024
1 parent d7d9e9a commit 25d7ac3
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
57 changes: 57 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Test Build

on:
push:
branches: [ dev ]

jobs:

build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Get Version
run: |
echo "TAGS=latest" >> $GITHUB_ENV
SUFFIX=""
VERSION=$(grep 'version:' version.yaml | cut -c 10-)$SUFFIX
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "REPO=$GITHUB_REPOSITORY" >> $GITHUB_ENV
echo "OWNER=$GITHUB_REPOSITORY_OWNER" >> $GITHUB_ENV
- name: Check if version is used
run: |
URL=$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/${{ env.VERSION }}
echo "$URL"
CODE=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
if [ "$CODE" != 404 ]; then
echo "Release '$VERSION' already exists. ($CODE)"
exit 1
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ env.OWNER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker Build & Push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
tags: |
${{ env.REPO }}:${{ env.VERSION }}
${{ env.REPO }}:latest
2 changes: 1 addition & 1 deletion version.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 0.1.3
version: 0.1.4

0 comments on commit 25d7ac3

Please sign in to comment.