From d9711cffa2bab8602634fe74ddebbc89b459cc48 Mon Sep 17 00:00:00 2001 From: nm17 Date: Wed, 5 Mar 2025 18:24:11 +0400 Subject: [PATCH] fuck this shit --- .forgejo/workflows/build_and_release.yml | 64 ++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .forgejo/workflows/build_and_release.yml diff --git a/.forgejo/workflows/build_and_release.yml b/.forgejo/workflows/build_and_release.yml new file mode 100644 index 0000000..6202c2f --- /dev/null +++ b/.forgejo/workflows/build_and_release.yml @@ -0,0 +1,64 @@ +name: Docker Image CI + +on: + push: + branches: ['main'] + pull_request: + +env: + REGISTRY: git.dc09.ru # Change to your registry (e.g., forgejo.example.com) + ORGANIZATION: nm17 # Docker Hub organization or Forgejo username + GITHUB_TOKEN: ${{ secrets.DOCKER_PASSWORD }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_TOKEN: ${{ secrets.DOCKER_PASSWORD }} + FORGEJO_URL: https://git.dc09.ru + +jobs: + build-and-push: + runs-on: ubuntu-latest + strategy: + matrix: + images: + - dockerfile: 'Dockerfile.openj9' + image_name: 'openj9' + context: './' + - dockerfile: 'Dockerfile.piped' + image_name: 'piped' + context: './' + # Add more images as needed + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + token: ${{ secrets.DOCKER_PASSWORD }} + opts.auth: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.REGISTRY }}/${{ env.ORGANIZATION }}/${{ matrix.image_name }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + github-token: ${{ secrets.DOCKER_PASSWORD }} + github-server: https://${{ env.REGISTRY }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: ${{ matrix.context }} + file: ${{ matrix.dockerfile }} + push: ${{ github.event_name == 'push' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file