From 3354be62b6ccfdbf680534fbac010dff6f504d47 Mon Sep 17 00:00:00 2001 From: Mohammad Mahdi Mohammadi Date: Sat, 4 Jan 2025 17:10:54 +0330 Subject: [PATCH] Minor fixes for gitea actions --- .gitea/workflows/gitea-ci.yml | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/gitea-ci.yml b/.gitea/workflows/gitea-ci.yml index 6546dfe..c3d25d0 100755 --- a/.gitea/workflows/gitea-ci.yml +++ b/.gitea/workflows/gitea-ci.yml @@ -1,7 +1,4 @@ -# -name: Create and publish Docker image - -# Configures this workflow to run every time a change is pushed to the branch called `release`. +name: release on: push: branches: [ "main" ] @@ -13,35 +10,38 @@ env: jobs: docker: + name: Build and push Docker image runs-on: ubuntu-latest - # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: contents: read packages: write attestations: write id-token: write - # + steps: - - name: Checkout repository - uses: actions/checkout@v4 - # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here. - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + - uses: actions/checkout@v4 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + install: true + - name: Log in to Container registry + uses: docker/login-action@v2 with: registry: git.mahdium.ir username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} - # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - - name: Extract metadata (tags, labels) for Docker + - name: Extract Docker metadata id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v4 with: images: git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot - - - name: Build and push - uses: docker/build-push-action@v5 + - name: Build and push Docker image + uses: docker/build-push-action@v4 with: - context: . - push: true - tags: | - git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot:latest + context: . + push: true + # tags: git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot${{gitea.sha}},git.mahdium.ir/mahdium/cats-of-mastodon-telegram-bot:latest + # labels: ${{ steps.meta.outputs.labels }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}