Skip to content

change domain

change domain #6

name: Push Docker image to GitHub Container Registry
on:
push:
workflow_dispatch:
jobs:
push_to_registry:
name: Build and push Docker image to GitHub Container Registry
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
name:
- frontend
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set ref_name
id: ref_name
run: echo "::set-output name=ref_name::$(echo ${{ github.ref_name }} | sed 's/[^a-z0-9_.-]/-/g')"
- name: Build Docker image
uses: docker/build-push-action@v5
with:
push: true
file: ./${{ matrix.name }}/Dockerfile
tags: |
ghcr.io/aokiapp/xrpense/${{ matrix.name }}:${{ github.sha }}
ghcr.io/aokiapp/xrpense/${{ matrix.name }}:b-${{ steps.ref_name.outputs.ref_name }}
ghcr.io/aokiapp/xrpense/${{ matrix.name }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max