diff --git a/.github/workflows/build-deliver.yaml b/.github/workflows/build-deliver.yaml new file mode 100644 index 0000000..7dd08bc --- /dev/null +++ b/.github/workflows/build-deliver.yaml @@ -0,0 +1,30 @@ +# docker continuous delivery +# build docker images and push to configured repo, with tags to match branches and git tags +--- +name: Build & Deliver +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout git commit + uses: actions/checkout@main + + - name: Publish server images to GitHub Container Registry + # TODO: pin to hash + uses: elgohr/Publish-Docker-Github-Action@main + with: + name: ${{ github.repository }}-server + registry: ghcr.io + + # GitHub actor + username: ${{ github.actor }} + + # GitHub access token + password: ${{ secrets.GITHUB_TOKEN }} + + # create docker image tags to match git tags + tag_names: true + + # build Dockerfile in server/ service directory + workdir: server diff --git a/.github/workflows/client.yaml b/.github/workflows/client.yaml deleted file mode 100644 index f04b478..0000000 --- a/.github/workflows/client.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Deploy UI to GH Pages -on: - push: - branches: - - main - paths: - - 'ui/**' - - 'client/**' - -jobs: - build-and-deploy: - concurrency: ci-${{ github.ref }} - runs-on: ubuntu-latest - steps: - - name: Checkout 🛎️ - uses: actions/checkout@v2 - - name: Install and Build 🔧 - working-directory: ./ui - run: | - npm ci - REACT_APP_REAL_SERVER_BASE=https://api.vaxx.link/api npm run build - mv build .. - - name: Build example viewer - working-directory: ./client - run: | - npm ci - npm run build - cp -r dist ../build/viewer - - name: Deploy 🚀 - uses: JamesIves/github-pages-deploy-action@v4.2.5 - with: - branch: gh-pages - folder: build diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml deleted file mode 100644 index 9beb81e..0000000 --- a/.github/workflows/server.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Deploy Server to k8s -on: - push: - branches: - - main - paths: - - 'server/**' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: azure/docker-login@v1 - with: - login-server: ${{ secrets.CONTAINER_REGISTRY }} - username: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientId }} - password: ${{ fromJSON(secrets.AZURE_CREDENTIALS).clientSecret }} - - uses: azure/login@v1 - with: - creds: ${{ secrets.AZURE_CREDENTIALS }} - - uses: azure/aks-set-context@v2.0 - with: - cluster-name: ${{ secrets.CLUSTER_NAME }} - resource-group: ${{ secrets.RESOURCE_GROUP }} - - name: Build and rollout to CI - working-directory: ./server - run: | - docker build . \ - -t ${{ secrets.CONTAINER_REGISTRY }}/vaxxlink:$GITHUB_SHA \ - -t ${{ secrets.CONTAINER_REGISTRY }}/vaxxlink:latest - docker push ${{ secrets.CONTAINER_REGISTRY }}/vaxxlink - kubectl -n vaxxlink rollout restart deployment/vaxxlink