From e954e91cdce6916a5f6d777719cf714c11e93550 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Mon, 21 Aug 2023 18:44:33 +0200 Subject: [PATCH] Add actions --- .gitea/workflows/release-nightly.yml | 51 ++++++++++++++++++++++++++ .gitea/workflows/release-tag.yml | 54 ++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 .gitea/workflows/release-nightly.yml create mode 100644 .gitea/workflows/release-tag.yml diff --git a/.gitea/workflows/release-nightly.yml b/.gitea/workflows/release-nightly.yml new file mode 100644 index 0000000..e75d62f --- /dev/null +++ b/.gitea/workflows/release-nightly.yml @@ -0,0 +1,51 @@ +name: release-nightly + +on: + push: + branches: [ main ] + +jobs: + release-image: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + env: + DOCKER_ORG: gitea + DOCKER_LATEST: nightly + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 # all history for all branches and tags + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: gitea.marijndoeve.nl + username: ${{ gitea.repository_owner }} + password: ${{ secrets.GITEA_TOKEN }} + + - name: Get Meta + id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + + - name: Build and push + uses: docker/build-push-action@v4 + env: + ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + with: + context: . + file: ./Containerfile + platforms: | + linux/amd64 + linux/arm/v7 + push: true + tags: | + ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }} diff --git a/.gitea/workflows/release-tag.yml b/.gitea/workflows/release-tag.yml new file mode 100644 index 0000000..fef823d --- /dev/null +++ b/.gitea/workflows/release-tag.yml @@ -0,0 +1,54 @@ +name: release-tag + +on: + push: + tags: + - '*' + +jobs: + release-image: + runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest + env: + DOCKER_ORG: marijn + DOCKER_LATEST: latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 # all history for all branches and tags + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + + - name: Login to Container Registry + uses: docker/login-action@v2 + with: + registry: gitea.marijndoeve.nl + username: ${{ gitea.repository_owner }} + password: ${{ secrets.GITEA_TOKEN }} + + - name: Get Meta + id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT + echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + + - name: Build and push + uses: docker/build-push-action@v4 + env: + ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 + with: + context: . + file: ./Containerfile + platforms: | + linux/arm64 + linux/arm/v7 + push: true + tags: | + ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }} + ${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}