Docker Pull Container To Github Package #30
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
# 对于速度快直接 Pull 的放在这里, 避免文件太多 | |
name: Docker Pull Container To Github Package | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * 1' | |
env: | |
TZ: Asia/Shanghai | |
IMAGE_NAME: "acme caddy chromedriver elixir gitea geckodriver haproxy influxdb meilisearch memcached minio portainer rabbitmq rust rsync traefik unit varnish" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker Image | |
run: | | |
for name in ${IMAGE_NAME}; do | |
docker build . -f images/${name}/latest/Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/${name}:latest | |
done | |
- name: Login to Docker Registry | |
run: | | |
docker login -u ${{vars.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ vars.DOCKER_REGISTRY }} | |
- name: Push Docker Image | |
run: | | |
for name in ${IMAGE_NAME}; do | |
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/${name}:latest | |
done |