mirror of
https://github.com/sethforprivacy/p2pool-docker.git
synced 2025-12-07 00:02:37 -05:00
65 lines
2.3 KiB
YAML
65 lines
2.3 KiB
YAML
name: "Update Image and Push to Github Packages and Docker Hub when Dockerfile is changed"
|
|
# Run this workflow every time a new commit pushed to your repository
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'Dockerfile'
|
|
jobs:
|
|
rebuild-container:
|
|
name: "Rebuild Container with the latest base image"
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Cache Docker layers
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: /tmp/.buildx-cache
|
|
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-buildx-
|
|
-
|
|
name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
-
|
|
name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: "Checkout repository"
|
|
uses: "actions/checkout@v2"
|
|
-
|
|
name: "Get Monero Release Tag"
|
|
id: get_tag
|
|
run: echo "::set-output name=tag::$(awk -F "=" '/MONERO_BRANCH=/ {print $2}' Dockerfile)"
|
|
-
|
|
name: Build and push to Docker Hub and Github Packages Docker Registry
|
|
id: docker_build
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
push: true
|
|
tags: |
|
|
ghcr.io/sethsimmons/simple-monerod-docker/simple-monerod:latest
|
|
ghcr.io/sethsimmons/simple-monerod-docker/simple-monerod:${{ steps.get_tag.outputs.tag }}
|
|
sethsimmons/simple-monerod:latest
|
|
sethsimmons/simple-monerod:${{ steps.get_tag.outputs.tag }}
|
|
cache-from: type=local,src=/tmp/.buildx-cache
|
|
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
|
-
|
|
# Temp fix
|
|
# https://github.com/docker/build-push-action/issues/252
|
|
# https://github.com/moby/buildkit/issues/1896
|
|
name: Move cache
|
|
run: |
|
|
rm -rf /tmp/.buildx-cache
|
|
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
|
-
|
|
name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }} |