diff --git a/.github/workflows/mage-pipeline.yaml b/.github/workflows/mage-pipeline.yaml new file mode 100644 index 0000000..a9e3fb8 --- /dev/null +++ b/.github/workflows/mage-pipeline.yaml @@ -0,0 +1,77 @@ +name: template-mage-pipeline + +## workflow will trigger on below condition, +## except image release that have jobs condition to trigger only on tagging +on: + pull_request: + branches: + - main + push: + branches: + - main + tags: + - 'v*.*.*' + + +env: + GCP_REGISTRY_ARTIFACT_PATH: us-docker.pkg.dev/world-engine-test/dark-forest + GCP_PROJECT_ID: world-engine-test + CARDINAL_REGISTRY_PATH: dark-forest/cardinal + NAKAMA_REGISTRY_PATH: dark-forest/nakama + +jobs: + mage-build: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + strategy: + matrix: + go-version: [1.20.x] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Mage - check + uses: magefile/mage-action@v2 + with: + version: latest + args: check + - name: Mage - build + uses: magefile/mage-action@v2 + with: + version: latest + args: build + mage-test: + runs-on: ubuntu-latest + needs: mage-build + defaults: + run: + shell: bash + strategy: + matrix: + go-version: [1.20.x] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + - name: Mage - check + uses: magefile/mage-action@v2 + with: + version: latest + args: check + - name: Mage - test + uses: magefile/mage-action@v2 + with: + version: latest + args: test