This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
chore: build to github registry #17
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 | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
env: | |
REGISTRY: ghcr.io/${{ github.repository_owner }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Log in to the Container registry | |
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get tag | |
id: get-tag | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
build-args: | | |
TARGET=${{ matrix.contract }} | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/elric-rs/app:latest | |
${{ env.REGISTRY }}/elric-rs/app:${{ steps.get-tag.outputs.short_ref }} |