name: Build and Push Image on: push: branches: - main env: REGISTRY_HOST: git.campbellwireless.net IMAGE_NAME: ${{ github.repository }} jobs: docker-build-and-push: runs-on: ubuntu-latest steps: - name: Checkout uses: https://cloud.campbellwireless.net/git/actions/checkout@v1 with: server-url: https://cloud.campbellwireless.net/git fetch-depth: 0 - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Gitea registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY_HOST }} username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - name: Compute image tags id: tags run: | echo "sha_short=$(echo '${{ github.sha }}' | cut -c1-12)" >> "$GITHUB_OUTPUT" - name: Build and push image uses: docker/build-push-action@v6 with: context: . file: ./Dockerfile push: true tags: | ${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY_HOST }}/${{ env.IMAGE_NAME }}:${{ steps.tags.outputs.sha_short }}