update CI pipeline #13
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: Main CI Workflow | |
on: push | |
env: | |
REPO_NAME: magda-configmap-dir-loader | |
jobs: | |
build-test-docker: | |
name: Build, Test & Push to Docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 12 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 12 | |
- run: yarn install | |
- run: yarn build | |
- run: yarn test | |
- name: Login to GitHub Container Registry | |
run: | | |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'` | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker Image & Push | |
run: | | |
REPO_OWNER=`echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'` | |
yarn docker-build-prod --repository=ghcr.io/${REPO_OWNER} --name=${REPO_NAME} --version=${GITHUB_SHA} --platform=linux/amd64,linux/arm64 | |
build-test-node-14: | |
name: Build, Test Only with Node 14 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js 14 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 14 | |
- run: yarn install | |
- run: yarn build | |
- run: yarn test |