Skip to content

👷 Remove BACKEND_URL variable #14

👷 Remove BACKEND_URL variable

👷 Remove BACKEND_URL variable #14

Workflow file for this run

name: Docker
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on:
push:
branches: ["deployment"]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Frontend Docker image
id: build-and-push-frontend
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: ./frontend
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/importantus/rsswipe-frontend:main
build-args: |
BACKEND_URL="https://backend.rsswipe.mcloud.digital"
- name: Build and push Backend Docker image
id: build-and-push-backend
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: ./backend
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/importantus/rsswipe-backend:main
deploy:
runs-on: ubuntu-latest
needs: build
container:
image: thlmylab/swakkd:stable
env:
KUBECONFIG_CONTENT: ${{ secrets.KUBECONFIG }}
KUBECONFIG: "/github/home/.kube/config"
UNIQUE_TAG: "${{ github.sha }}-${{ github.run_number }}-${{ github.run_attempt }}"
DATABASE_URL: ${{ secrets.DATABASE_URL }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
APP_NAME: "rsswipe"
BACKEND_IMAGE: "importantus/rsswipe-backend:main"
FRONTEND_IMAGE: "importantus/rsswipe-frontend:main"
permissions:
contents: read
steps:
- uses: actions/checkout@v3
- run: mkdir -p ~/.kube/ && echo "$KUBECONFIG_CONTENT" > ~/.kube/config
- run: mo deployment/frontend/service.yml| kubectl apply -f -
- run: mo deployment/frontend/deployment.yml| kubectl apply -f -
- run: mo deployment/backend/service.yml| kubectl apply -f -
- run: mo deployment/backend/deployment.yml| kubectl apply -f -
- run: mo deployment/backend/volume.yml| kubectl apply -f -
- run: mo deployment/backend/database.yml| kubectl apply -f -
- run: mo deployment/ingress.yml| kubectl apply -f -
# - run: mo deployment/deployment.yml| kubectl delete -f - || true