forked from lthn/blockchain
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: chain-itw3:testnet
|
|
on:
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- v*
|
|
paths-ignore:
|
|
- '**.md'
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- v*
|
|
paths-ignore:
|
|
- '**.md'
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Cancel Previous Runs
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
install: true
|
|
- name: Login to GitHub Container registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v2
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Docker Build
|
|
if: ${{ github.event_name != 'pull_request' }}
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: utils/docker/Dockerfile
|
|
cache-to: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.ref_name }}
|
|
cache-from: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.ref_name }}
|
|
push: true
|
|
tags: lthn/chain:testnet-${{ github.ref_name }},ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.ref_name }}
|
|
- name: Docker Build
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: .
|
|
file: utils/docker/Dockerfile
|
|
cache-to: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.head_ref }}
|
|
cache-from: ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.head_ref }}
|
|
push: true
|
|
tags: lthn/chain:testnet-${{ github.head_ref }},ghcr.io/letheanvpn/blockchain-itw3:testnet-${{ github.head_ref }}
|
|
|