Skip to content

Payment impl

Payment impl #74

Workflow file for this run

name: Build
on:
pull_request:
branches:
- main
- master
push:
branches:
- main
- master
jobs:
analyze-commits:
runs-on: ubuntu-latest
steps:
-
name: Echo DOCKER_IMAGE_REPOSITORY
run: "echo DOCKER_IMAGE_REPOSITORY: '${{ vars.DOCKER_IMAGE_REPOSITORY }}'"
-
name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
-
name: "🔧 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 18.x
-
name: Install dependencies
run: yarn global add semantic-release@22.0.12 @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/exec @semantic-release/release-notes-generator @semantic-release/commit-analyzer@10.0.1 conventional-changelog-conventionalcommits@6.1.0
-
name: Get next version
id: next-version
run: semantic-release --dryRun
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
outputs:
release-tag: ${{ steps.next-version.outputs.release-tag }}
release-version: ${{ steps.next-version.outputs.release-version }}
docker:
uses: ./.github/workflows/docker-build-and-push-workflow.yml
needs: analyze-commits
secrets: inherit
with:
version: ${{ needs.analyze-commits.outputs.release-version }}
publish: >-
${{ (startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/master') &&
github.event_name == 'push' }}
docker-image-repo: ${{ vars.DOCKER_IMAGE_REPOSITORY }}
upload-sarif-to-security: >-
${{ (startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/master') &&
github.event_name == 'push' }}
release:
runs-on: ubuntu-latest
needs: publish-docker
if: >-
${{ (startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/master') &&
github.event_name == 'push' &&
needs.analyze-commits.outputs.release-version != '' &&
needs.analyze-commits.outputs.release-version != null }}
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
-
name: Update BuildInfo.properties if there is a version
run: /bin/bash .github/workflows/writeBuildInfo.sh ${{ needs.analyze-commits.outputs.release-version }}
-
name: "🔧 setup node"
uses: actions/setup-node@v2.1.5
with:
node-version: 18.x
-
name: Install dependencies
run: yarn global add semantic-release@22.0.12 @semantic-release/changelog @semantic-release/git @semantic-release/github @semantic-release/exec @semantic-release/release-notes-generator @semantic-release/commit-analyzer@10.0.1 conventional-changelog-conventionalcommits@6.1.0
-
name: Semantic Release
run: "semantic-release"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
publish-docker:
runs-on: ubuntu-latest
needs:
- docker
- analyze-commits
if: >-
${{ (startsWith(github.ref, 'refs/tags/') ||
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/master') &&
github.event_name == 'push' &&
needs.analyze-commits.outputs.release-version != '' &&
needs.analyze-commits.outputs.release-version != null }}
steps:
-
name: Show release version
run: echo "Pushing docker image for version ${{ needs.analyze-commits.outputs.release-version }}"
-
name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
-
name: "Download Docker artifact"
uses: actions/download-artifact@v2
with:
name: docker
path: /tmp
-
name: "Load Docker artifact"
run: |
docker load --input /tmp/docker.tar
docker image ls -a
-
name: Login to Container Registry
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push Docker image
run: docker push ${{ vars.DOCKER_IMAGE_REPOSITORY }} --all-tags