From 25d7ac3fda1f25396a930fb9a6155c3868c7fe53 Mon Sep 17 00:00:00 2001 From: Eduardo Folly Date: Mon, 12 Feb 2024 18:44:46 -0300 Subject: [PATCH] Test docker with qemu. --- .github/workflows/dev.yml | 57 +++++++++++++++++++++++++++++++++++++++ version.yaml | 2 +- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/dev.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..84cb1d7 --- /dev/null +++ b/.github/workflows/dev.yml @@ -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 diff --git a/version.yaml b/version.yaml index 4aa7ac6..7fbccf5 100644 --- a/version.yaml +++ b/version.yaml @@ -1 +1 @@ -version: 0.1.3 +version: 0.1.4