Add docker image to repo #1
Workflow file for this run
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: Docker | ||
env: | ||
NODE_VERSION: 18.16.1 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
build-docker: | ||
needs: lint-test-build | ||
name: Build and upload docker image and archive | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm i | ||
- name: Run tests | ||
run: npx nx e2e mel-datahub-e2e | ||
- name: Build datahub and produce archives | ||
if: github.event_name == 'release' | ||
run: | | ||
npx nx build datahub | ||
- uses: docker/login-action@v1 | ||
name: Login to GitHub Container Registry | ||
with: | ||
registry: ghcr.io | ||
username: c2c-bot-gis-ci | ||
password: ${{ secrets.GOPASS_CI_GITHUB_TOKEN }} | ||
- name: "Pushing the image onto ghcr.io" | ||
run: | | ||
docker image ls --format '{{.Repository}}:{{.Tag}}' --filter=reference='ghcr.io/camptocamp/mel-dataplatform/*' | \ | ||
xargs -r -L1 docker push $1 | ||
agents: | ||
name: Nx Cloud - Agents | ||
uses: nrwl/ci/.github/workflows/[email protected] | ||
with: | ||
number-of-agents: 3 |