Output logs #281
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: build | |
on: [push] | |
jobs: | |
metadata: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v2 | |
# If we're building a published image then embed the UI | |
- name: Build embedded UI | |
if: github.ref == 'refs/heads/master' | |
run: | | |
# Regenerate graphql schema | |
cd metadata | |
go generate ./ | |
cd .. | |
# Build the UI | |
cd ./ui | |
npm install --include=dev | |
npm run generate | |
npm run build | |
cp -r dist ../metadata/ui_build | |
cd .. | |
- name: Build | |
run: | | |
cd ./metadata | |
docker build . -t scalardev/trawler:$GITHUB_SHA | |
- name: Login to Docker Hub | |
if: github.ref == 'refs/heads/master' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Push | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker push scalardev/trawler:$GITHUB_SHA | |
ui: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Out Repo | |
uses: actions/checkout@v2 | |
- name: Setup Go 1.21.x | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
- name: Generate GraphQL Schema | |
run: | | |
cd metadata | |
go mod download | |
go generate ./ | |
cp -r graphql/ ../ui/graphql_schema | |
cd - | |
- name: Build | |
run: | | |
cd ui | |
docker build -t scalardev/trawler-ui:$GITHUB_SHA . | |
- name: Login to Docker Hub | |
if: github.ref == 'refs/heads/master' | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Push | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker tag scalardev/trawler-ui:$GITHUB_SHA scalardev/trawler-ui:latest | |
docker image push --all-tags scalardev/trawler-ui | |
# deploy: | |
# runs-on: ubuntu-latest | |
# concurrency: deploy-${{ github.ref }} | |
# if: github.ref == 'refs/heads/master' | |
# needs: | |
# - server | |
# steps: | |
# - name: Check Out Repo | |
# uses: actions/checkout@v2 | |
# - name: Install scaleway & kustomize | |
# run: | | |
# curl -o scw -L "https://github.com/scaleway/scaleway-cli/releases/download/v2.3.1/scw-2.3.1-linux-x86_64" | |
# chmod +x scw | |
# curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash | |
# - name: kubectl | |
# env: | |
# SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | |
# SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
# SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
# SCW_ZONE: fr-par-1 | |
# TRAWLER_SECRET: ${{ secrets.TRAWLER_SECRET }} | |
# PGPASSWORD: ${{ secrets.TRAWLER_DB_PASSWORD }} | |
# run: | | |
# ./scw k8s kubeconfig install a1a3ab1f-497d-4b50-bf89-7ef3223368f8 | |
# pushd k8s/overlays/prod | |
# kustomize edit set image scalardev/trawler=scalardev/trawler:$GITHUB_SHA | |
# popd | |
# kubectl apply -k k8s/overlays/prod | |
# kubectl rollout status deployment/trawler --timeout=30s |