Skip to content

Commit

Permalink
fix: build pipeline (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
akdasa authored May 12, 2023
1 parent 1ab6cec commit 6e66fb0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
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

0 comments on commit 6e66fb0

Please sign in to comment.