Skip to content

Copy wildcard instead of relative path #16

Copy wildcard instead of relative path

Copy wildcard instead of relative path #16

Workflow file for this run

name: Staging Deployment Backend
on:
push:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: checkout backend
with:
sparse-checkout: |
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "21.1.0"
- run: npm ci
name: install dependencies
working-directory:
- run: npm run test
name: test with npm
working-directory:
lint-format:
name: lint and format backend
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
name: checkout backend
with:
sparse-checkout: |
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "21.1.0"
- run: npm ci
name: install dependencies
working-directory:
- run: |
if ! npm run format -- --check .; then
echo "Please format the code by running: npm run format"
exit 1
fi
name: check code formatting
working-directory:
build-image:
runs-on: ubuntu-22.04
needs: [lint-format, test]
name: build & push docker image
steps:
- uses: actions/checkout@v4
name: checkout backend
with:
sparse-checkout: |
./
- name: set up QEMU
uses: docker/setup-qemu-action@v3
- name: set up docker buildx
uses: docker/setup-buildx-action@v3
- name: docker metadata
id: metadata
uses: docker/metadata-action@v5
with:
images: lnart/dryager-backend
tags: |
type=raw,value=${{ github.sha }}
type=raw,value=latest
- name: log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: build and push
uses: docker/build-push-action@v5
with:
context: ./
platforms: linux/amd64, linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max