Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build pipeline #206

Merged
merged 16 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
2 changes: 2 additions & 0 deletions .env.testing:prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_PROTOCOL=http
VITE_HOST=balancer
23 changes: 10 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read

steps:
- name: 📥 Checkout
Expand All @@ -85,9 +86,8 @@ jobs:
tags: shlokas:latest
outputs: type=docker,dest=/tmp/shlokas-container.tar
build-args: |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENVIRONMENT: testing

GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
ENVIRONMENT=testing

- name: 🐳 Upload artifact
uses: actions/upload-artifact@v3.1.2
Expand Down Expand Up @@ -120,19 +120,16 @@ jobs:
- name: 🐳 Load Docker image
run: |
docker load --input /tmp/shlokas-container.tar
docker image ls -a

# - name: Environment
# uses: isbang/compose-action@v1.4.1
# with:
# compose-file: |
# docker-compose.yml
# docker-compose.testing.yml
# docker-compose.testing.ci.yml
# down-flags: "--volumes"
- name: 🐳 Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: 🐳 Start server
run: ./shlokas.run.sh testing
run: docker login --username=${{ github.actor }} --password=${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }} && ./shlokas.run.sh testing
shell: bash

- name: 🧪 Testing
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ FROM node:19.8.1-alpine3.17 AS build

ARG GITHUB_TOKEN
ARG ENVIRONMENT=prod
ENV GITHUB_TOKEN=${GITHUB_TOKEN}

# -------------------- Install and cache app dependencies -------------------- #

WORKDIR /app
COPY package.json package-lock.json .npmrc ./
RUN GITHUB_TOKEN=${GITHUB_TOKEN} npm ci
RUN npm ci

# --------------------------------- Build app -------------------------------- #

Expand Down