diff --git a/.gitea/workflows/build-ci-image.yaml b/.gitea/workflows/build-ci-image.yaml new file mode 100644 index 0000000..188c25d --- /dev/null +++ b/.gitea/workflows/build-ci-image.yaml @@ -0,0 +1,40 @@ +name: Build & Push CI Image + +on: + push: + paths: + - "Dockerfile.ci" + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Prepare Metadata + id: meta + run: | + REGISTRY_HOST=$(echo "${{ gitea.server_url }}" | sed -e 's|https://||' -e 's|http://||') + + REPO_POSTFIXED=$(echo "${{ gitea.repository }}-ci" | tr '[:upper:]' '[:lower:]') + + echo "registry=$REGISTRY_HOST" >> $GITHUB_OUTPUT + echo "repo_path=$REPO_POSTFIXED" >> $GITHUB_OUTPUT + + - name: Login to Gitea Registry + uses: docker/login-action@v3 + with: + registry: ${{ steps.meta.outputs.registry }} + username: ${{ gitea.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile.ci + push: true + tags: | + ${{ steps.meta.outputs.registry }}/${{ steps.meta.outputs.repo_path }}:latest + ${{ steps.meta.outputs.registry }}/${{ steps.meta.outputs.repo_path }}:${{ github.sha }} diff --git a/Dockerfile b/Dockerfile.ci similarity index 90% rename from Dockerfile rename to Dockerfile.ci index 4444bd9..ac54dc2 100644 --- a/Dockerfile +++ b/Dockerfile.ci @@ -12,8 +12,8 @@ RUN apt-get update && apt-get install -y \ xvfb ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH + CARGO_HOME=/usr/local/cargo \ + PATH=/usr/local/cargo/bin:$PATH RUN curl --silent --show-error --location --fail --retry 3 \ --proto '=https' --tlsv1.2 \