feat(main): add sync images (#47) #77
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
name: 🔍 Go for Push | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
job0: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Set up Go | |
uses: actions/setup-go@master | |
with: | |
go-version: 1.23.x | |
- name: Prepare | |
id: prepare | |
run: | | |
TAG=${GITHUB_REF#refs/tags/} | |
echo ::set-output name=tag_name::${TAG} | |
- name: set up buildx | |
id: buildx | |
uses: crazy-max/ghaction-docker-buildx@v1 | |
with: | |
version: latest | |
- name: Login to Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GH_TOKEN }} | |
- name: build (and publish) main image | |
env: | |
# fork friendly ^^ | |
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/automq-operator | |
run: | | |
IMG=${DOCKER_REPO}:latest make docker-buildx | |
job1: | |
runs-on: ubuntu-20.04 | |
needs: job0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Set up Go | |
uses: actions/setup-go@master | |
with: | |
go-version: 1.23.x | |
- name: Verify sealos | |
run: | | |
curl -sfL https://raw.githubusercontent.com/labring/sealos/v5.0.0/scripts/install.sh | sh -s v5.0.0 labring/sealos | |
- name: build | |
run: | | |
go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info | |
cd deploy | |
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:latest" | |
sudo sealos build -t "${IMAGE_NAME}"-amd64 --platform linux/amd64 . && sudo rm -rf registry | |
sudo sealos build -t "${IMAGE_NAME}"-arm64 --platform linux/arm64 . && sudo rm -rf registry | |
sudo sealos login -u ${{ github.repository_owner }} -p ${{ secrets.GH_TOKEN }} --debug ghcr.io | |
bash manifest.sh ${IMAGE_NAME} | |
sync: | |
runs-on: ubuntu-20.04 | |
needs: job1 | |
steps: | |
- name: build | |
run: | | |
gh issue comment ${{ vars.SEALOS_ISSUE_NUMBER }} --body "/imagebuild_apps automq-operator latest" --repo ${{ vars.SEALOS_ISSUE_REPO }} |