Merge pull request #77 from yasuyuky/dependabot/docker/rust-1.73.0-bu… #66
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: CI | |
on: | |
push: | |
branches: | |
- main | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: rust-arm | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Commit files | |
id: tagging | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "Yasuyuki YAMADA" | |
TAGNAME=$(grep FROM Dockerfile|cut -f 2 -d ':'|cut -f 1 -d '-') | |
git tag -f -a ${TAGNAME} -m "${TAGNAME} Tagged by CI" | |
echo tag=${TAGNAME} >>$GITHUB_OUTPUT | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest | |
${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:${{ steps.tagging.outputs.tag }} |