Skip to content

Docker Build CrossOver #16

Docker Build CrossOver

Docker Build CrossOver #16

name: Docker Build CrossOver
on:
workflow_dispatch:
schedule:
- cron: '0 2 * * 1'
env:
TZ: Asia/Shanghai
REGISTRY: ghcr.io
IMAGE_NAME: crossover
IMAGE_TAGS: 'latest'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
ROOT_PATH=$(pwd)
for tag in ${IMAGE_TAGS}; do
cd ${ROOT_PATH}/images/${{ env.IMAGE_NAME }}/${tag}
docker build . -f Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag}
done
- name: Login Github Package Registry
run: |
docker login -u ${{vars.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ vars.DOCKER_REGISTRY }}
- name: Push Docker Image To Github Package
run: |
for tag in ${IMAGE_TAGS}; do
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/${{ env.IMAGE_NAME }}:${tag}
done