Update go #80
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: lotus-fvm-localnet-base | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/container-base.yml | |
- Dockerfile-base | |
- lotus | |
- go-jsonrpc | |
repository_dispatch: | |
types: [manual-run-base] | |
workflow_dispatch: {} | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }}-base | |
jobs: | |
run-build-and-push-oci-image: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
actions: write | |
outputs: | |
digest: ${{ steps.build.outputs.digest }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Setup Docker Buildx | |
uses: docker/[email protected] | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
id: build | |
uses: docker/[email protected] | |
with: | |
context: . | |
file: Dockerfile-base | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Update Dockerfile-ready | |
run: | | |
echo Digest: ${{ steps.build.outputs.digest }} | |
perl -pi -e "s#^FROM .*#FROM ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}\@${{ steps.build.outputs.digest }}#" Dockerfile-ready | |
- name: Commit and push changes to Dockerfile-ready | |
run: | | |
set -euo pipefail | |
set -x | |
git config --global user.name 'update-image-hash' | |
git config --global user.email '[email protected]' | |
git status | |
git add Dockerfile-ready | |
if [ -n "$(git status --porcelain)" ]; then | |
git commit -m 'Update lotus-fvm-localnet-base from action' | |
#git pull | |
git push | |
fi | |
- name: Trigger -ready build | |
run: | | |
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
https://api.github.com/repos/${{ github.repository }}/dispatches \ | |
-d '{"event_type":"manual-run-ready"}' |