Merge pull request #50 from xrplevm/dependabot/go_modules/golang.org/… #68
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: "Branch" | |
on: | |
push: | |
branches: | |
- "main" | |
concurrency: | |
# Cancel old runs if there is a new commit in the same branch | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
integration: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Retrieve branch name | |
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ github.job }}-${{ runner.os }}-${{ env.BRANCH }}-buildx | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-${{ env.BRANCH }}-buildx | |
# Docker login | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PUSH_TOKEN }} | |
# Build and push docker image | |
- name: Build docker image | |
uses: docker/build-push-action@v4 | |
with: | |
target: release | |
push: true | |
tags: peersyst/exrp:${{ env.BRANCH }} | |
cache-from: type=local,src=/tmp/.buildx-cache | |
cache-to: type=local,dest=/tmp/.buildx-cache-new | |
- name: Move cache | |
if: always() | |
run: | | |
rm -rf /tmp/.buildx-cache | |
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |