Fix uri helpers (#2) #18
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: Dev build | |
on: | |
push: | |
branches: | |
- "**" | |
env: | |
REGISTRY: docker.io | |
USERNAME: luarvic | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build-test-and-push-api-image: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./api/src/click2approve.WebAPI | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
dotnet-version: [8.0.x] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet-version }} | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build | |
- name: Test | |
run: dotnet test | |
working-directory: ./api | |
- name: Log in to Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ env.USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./api | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-api:dev | |
labels: ${{ steps.meta.outputs.labels }} | |
build-test-and-push-ui-image: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./ui | |
permissions: | |
contents: read | |
packages: write | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: ui/package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Test | |
run: npm test | |
- name: Log in to Container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ env.USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ui | |
push: true | |
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ui:dev | |
labels: ${{ steps.meta.outputs.labels }} |