Skip to content

Commit

Permalink
Update acr_sync.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kenwoodjw authored Sep 13, 2024
1 parent 5b8468c commit f9f515e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/acr_sync.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Sync Docker Images to Alibaba Cloud
name: Sync Docker Images to Alibaba Cloud from Docker Compose

on:
push:
Expand All @@ -10,25 +10,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout code from Dify repo
uses: actions/checkout@v3
with:
repository: langgenius/dify # 拉取 langgenius/dify 仓库
path: dify-repo # 将该 repo 克隆到 dify-repo 目录中

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Alibaba Cloud ACR
run: echo "${{ secrets.ACR_PASSWORD }}" | docker login ${{ secrets.ACR_REGISTRY }} --username ${{ secrets.ACR_USERNAME }} --password-stdin
- name: Install yq
run: |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.27.3/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
- name: Read image list from txt file
id: read_image_list
- name: Parse docker-compose.yaml for images
id: parse_docker_compose
run: |
images=$(cat ./images.txt | tr '\n' ' ')
images=$(yq e '.services[].image' dify-repo/docker/docker-compose.yaml | tr '\n' ' ')
echo "Images: $images"
echo "::set-output name=images::$images"
- name: Log in to Alibaba Cloud ACR
run: echo "${{ secrets.ACR_PASSWORD }}" | docker login ${{ secrets.ACR_REGISTRY }} --username ${{ secrets.ACR_USERNAME }} --password-stdin

- name: Pull and push images to Alibaba Cloud ACR
run: |
images="${{ steps.read_image_list.outputs.images }}"
images="${{ steps.parse_docker_compose.outputs.images }}"
for image in $images; do
echo "Processing image: $image"
Expand Down

0 comments on commit f9f515e

Please sign in to comment.