Refactoret koden til å bruke environment variabler + gjorde den litt … #474
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: tripletexweb | |
on: [push] | |
jobs: | |
frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '20.x' | |
- run: npm ci | |
working-directory: tripletexweb/frontend | |
- run: npm run typecheck | |
working-directory: tripletexweb/frontend | |
- run: npm run build | |
working-directory: tripletexweb/frontend | |
- run: docker build -t cybernetisk/okoreports-frontend . | |
working-directory: tripletexweb/frontend | |
- name: Push docker image to Docker Hub if master branch | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD | |
docker push cybernetisk/okoreports-frontend | |
env: | |
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: pip install -e ".[dev]" | |
working-directory: tripletex | |
- run: python setup.py bdist_wheel -d .. | |
working-directory: tripletex | |
- run: docker build -t cybernetisk/okoreports-backend -f tripletexweb/backend/Dockerfile . | |
- name: Push docker image to Docker Hub if master branch | |
if: github.ref == 'refs/heads/master' | |
run: | | |
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD | |
docker push cybernetisk/okoreports-backend | |
env: | |
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |