state: do not overwrite currentContract #891
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automatic build and push | |
on: | |
push: | |
branches: | |
- main | |
- release | |
pull_request: | |
branches: | |
- main | |
- release | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
docker: | |
name: "Docker build" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release_branches: release | |
pre_release_branches: main | |
default_bump: minor | |
default_prerelease_bump: prepatch | |
append_to_pre_release_tag: rc | |
- name: Testing | |
if: ${{ startsWith(github.ref,'refs/heads/') || github.event_name == 'pull_request' }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18.x" | |
run: | | |
npm ci | |
npm t | |
- name: Build | |
if: ${{ startsWith(github.ref,'refs/heads/') || github.event_name == 'pull_request' }} | |
uses: docker/build-push-action@v4 | |
with: | |
file: ./Dockerfile | |
push: false | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: ENV=prod | |
- name: Build and push staging version | |
if: ${{ ! github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }} | |
uses: docker/build-push-action@v4 | |
with: | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/marigold-dev/tzsafe:${{ steps.tag_version.outputs.new_version}} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: ENV=dev | |
- name: Build and push release version | |
if: ${{ ! github.event_name != 'pull_request' && github.ref == 'refs/heads/release' }} | |
uses: docker/build-push-action@v4 | |
with: | |
file: ./Dockerfile | |
push: true | |
tags: | | |
ghcr.io/marigold-dev/tzsafe:stable | |
ghcr.io/marigold-dev/tzsafe:${{ steps.tag_version.outputs.new_version}}-release | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-args: ENV=prod |