Skip to content

Commit

Permalink
try syncing images
Browse files Browse the repository at this point in the history
  • Loading branch information
aine-etke committed Aug 22, 2024
1 parent 2f7c016 commit 224e84e
Showing 1 changed file with 55 additions and 33 deletions.
88 changes: 55 additions & 33 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,65 @@ jobs:
# ANSIBLE=${{ env.ansible }}
# ANSIBLE_CORE=${{ env.ansible_core }}

build-fresh:
name: Build ansible image (fresh)
# needs: build-base
# build-fresh:
# name: Build ansible image (fresh)
# needs: build-base
# runs-on: self-hosted
# if: ${{ github.ref == 'refs/heads/fresh' }}
# steps:
# - uses: actions/checkout@v4
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to ghcr.io
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: |
# ghcr.io/${{ github.repository }}
# registry.etke.cc/${{ github.repository }}
# tags: |
# type=raw,value=fresh,enable=${{ github.ref_name == 'fresh' }}
# - name: Build and push
# uses: docker/build-push-action@v6
# with:
# platforms: linux/amd64,linux/arm64
# push: true
# context: .
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
# build-args: |
# AGRU=${{ env.agru }}
# ALPINE=${{ env.alpine }}
# ANSIBLE=${{ env.ansible }}
# ANSIBLE_CORE=${{ env.ansible_core }}

sync-images:
name: Sync images
# needs: build-fresh
runs-on: self-hosted
if: ${{ github.ref == 'refs/heads/fresh' }}
container:
image: ghcr.io/${{ github.repository }}:fresh
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
registry.etke.cc/${{ github.repository }}
tags: |
type=raw,value=fresh,enable=${{ github.ref_name == 'fresh' }}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
AGRU=${{ env.agru }}
ALPINE=${{ env.alpine }}
ANSIBLE=${{ env.ansible }}
ANSIBLE_CORE=${{ env.ansible_core }}
- name: Sync images
env:
MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }}
MATRIX_URL_FRESH: ${{ secrets.MATRIX_URL_FRESH }}
CI_COMMIT_MESSAGE: ${{ github.event.push.head_commit.message }}
run: |
apk --no-cache add skopeo parallel curl
skopeo login --username ${{ secrets.DOCKER_HUB_LOGIN }} --password ${{ secrets.DOCKER_HUB_PASSWORD }} docker.io
cp -r /playbook/.config/inventory /
cd /playbook; ansible-playbook play/all.yml -l localhost -t skopeo -e target=localhost
sh play/.skopeo-parallel
./bin/ci-notify.sh
build-stable:
name: Build ansible image (stable)
Expand Down

0 comments on commit 224e84e

Please sign in to comment.