Build in github #1
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: Build | |
on: [push] | |
permissions: | |
id-token: write | |
packages: write | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Retrieve environment variables | |
run: make env >> $GITHUB_ENV | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/${{ github.repository_owner }}/cartesi-lambada-base-machine,enable=${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/tags/v') }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Download dependencies | |
run: make download | |
- name: Build docker image | |
id: docker_build | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64 | |
tags: zippiehq/cartesi-lambada-base-machine:devel | |
push: false | |
load: true | |
- name: Push docker image | |
id: docker_push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64 | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
push: true | |
load: false |