Update creator_workflow.yml #9
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: CREATOR workflow CI | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
creator-checker: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- run: npm run build --if-present | |
- run: npm run test-creator-node | |
build-creator-cl: | |
name: Build creator_cl Docker Image | |
needs: creator-checker | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Package Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build & Push Docker image | |
run: cd ./dockers/command_line/ && docker buildx build -t ghcr.io/${{ github.repository_owner }}/creator_cl -f ./Dockerfile --push --platform=linux/arm64,linux/amd64 . | |
push-creator-cl: | |
name: Push creator_cl Docker Image | |
needs: build-creator-cl | |
if: github.event_name != 'pull_request' && github.repository_owner == 'creatorsim' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Login to Docker Hub | |
env: | |
DH_TOKEN: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
run: docker login -u creatorsim -p ${DH_TOKEN} | |
- name: Re-tag & Push Docker Image to Docker Hub | |
run: | | |
# make config.json avaiable to regclient in docker container | |
chmod +r $HOME/.docker/config.json | |
# Run regclient in docker image | |
docker container run --rm --network host -v regctl-conf:/home/appuser/.regctl/ -v $HOME/.docker/config.json:/home/appuser/.docker/config.json regclient/regctl:v0.3.9 image copy ghcr.io/${{ github.repository_owner }}/creator_cl docker.io/creatorsim/creator_cl | |
build-creator-gateway: | |
name: Build creator_gateway Docker Image | |
needs: creator-checker | |
if: github.event_name != 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to GitHub Package Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build & Push Docker image | |
run: cd ./dockers/gateway/ && docker buildx build -t ghcr.io/${{ github.repository_owner }}/creator_gateway -f ./Dockerfile --push --platform=linux/arm64,linux/amd64 . |