Merge pull request #366 from rsksmart/unused-import #9
Workflow file for this run
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: Docker Image Build and Push | |
on: | |
push: | |
tags: | |
- '*' | |
# Declare default permissions as read only. | |
permissions: read-all | |
env: | |
GHCR_REPO: "ghcr.io/rsksmart/powpeg-node" | |
DOCKERHUB_REPO: "rsksmart/powpeg-node" | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 #v4.2.1 | |
- name: Set version | |
id: vars | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 #v5.5.1 | |
with: | |
images: | | |
${{ env.DOCKERHUB_REPO }} | |
${{ env.GHCR_REPO }} | |
tags: | | |
type=ref,event=tag | |
type=edge | |
# This is used for generating IRIS-3 out of IRIS-3.x.y. | |
type=match,pattern=(\w+-\d+)\.\d+\.\d+.*,group=1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 #v3.7.1 | |
with: | |
driver: docker | |
- name: Build Docker Image | |
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 #v6.9.0 | |
with: | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
build-args: RSK_RELEASE=${{ steps.vars.outputs.tag }} | |
- name: DockerHub login | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: GitHub container registry login | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push Images | |
run: | | |
docker push ${{ env.DOCKERHUB_REPO }} | |
docker push ${{ env.GHCR_REPO }} |