Bump typescript from 5.1.6 to 5.2.2 in /frontend (#915) #2269
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: ci | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
gotest: | |
name: Test Backend | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: "1.20" | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: Build | |
run: go build -v ./... | |
- name: gofmt | |
run: | | |
GOFMTOUT=$(gofmt -l .) | |
if [[ ! -z "${GOFMTOUT}" ]]; then | |
echo "FATAL: gofmt violation(s), please fix" | |
echo $GOFMTOUT | |
exit -1 | |
fi | |
- name: go vet | |
run: go vet ./... | |
- name: Test | |
run: | | |
docker run --rm -d -v $(pwd)/backend/schema.sql:/docker-entrypoint-initdb.d/schema.sql -e MYSQL_DATABASE=dev-db -e MYSQL_ROOT_PASSWORD=dev-root-password -e MYSQL_USER=dev-user -e MYSQL_PASSWORD=dev-user-password -p3306:3306 mysql | |
while ! mysqladmin ping -h"127.0.0.1" --silent; do | |
sleep 1 | |
done | |
go test -v ./... | |
build_push: | |
name: Build and Push | |
needs: [gotest] | |
strategy: | |
matrix: | |
service: [frontend,web,api,init] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v4.6.0 | |
with: | |
images: ashirt/${{ matrix.service }} # list of Docker images to use as base name for tags | |
tags: | | |
type=sha | |
type=ref,event=branch | |
type=ref,event=pr | |
flavor: | | |
latest=false | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2.2.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v2.10.0 | |
- name: Build and Push PR | |
if: github.ref != 'refs/heads/main' | |
uses: docker/build-push-action@v4.1.1 | |
with: | |
context: . | |
file: Dockerfile.prod.${{ matrix.service }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
platforms: linux/amd64 | |
push: true # Push with pr-### and sha-xxxxxxx tags | |
- name: Build and Push Latest | |
if: github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v4.1.1 | |
with: | |
context: . | |
file: Dockerfile.prod.${{ matrix.service }} | |
tags: ${{ steps.docker_meta.outputs.tags }}, ashirt/${{ matrix.service }}:latest #Add latest tag for main | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
platforms: linux/amd64 | |
push: true |