Skip to content

Commit

Permalink
[fix] fixed node version and cleaned up github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Prajwalprakash3722 committed Jan 29, 2024
1 parent 9d00486 commit a4752c1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 59 deletions.
59 changes: 4 additions & 55 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,18 @@
name: Docker
name: TestBuild

on:
workflow_dispatch:
push:
# Publish `master` as Docker `latest` image.
branches:
branches-ignore:
- master

# Publish `v1.2.3` tags as releases.
tags:
- v*

# Run tests for any PRs.
pull_request:

env:
IMAGE_NAME: ieee-csitss

jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Setup environment
run: yarn install --frozen-lockfile

- name: Build
run: NODE_ENV=production yarn build

- name: Make sure build works
run: |
docker build . --file Dockerfile.production
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
needs: test

runs-on: ubuntu-20.04
if: github.event_name == 'push'

steps:
- uses: actions/checkout@v2

- name: Build image
run: docker build . --file Dockerfile.production --tag $IMAGE_NAME

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
run: NODE_ENV=production yarn build
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"name": "Prajwal Prakash",
"url": "https://www.devcoffee.me"
},
"engines": {
"npm": ">=9.0.0",
"node": ">=18.0.0"
},
"license": "MIT",
"description": "PWA to interact with users for CSITSS",
"scripts": {
Expand Down Expand Up @@ -62,4 +66,4 @@
"tailwindcss": "^3.0.24",
"ts-node": "^10.7.0"
}
}
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -713,9 +713,9 @@ camelcase-css@^2.0.1:
integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==

caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335:
version "1.0.30001341"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001341.tgz"
integrity sha512-2SodVrFFtvGENGCv0ChVJIDQ0KPaS1cg7/qtfMaICgeMolDdo/Z2OD32F0Aq9yl6F4YFwGPBS5AaPqNYiW4PoA==
version "1.0.30001581"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz"
integrity sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==

chalk@^4.0.0, chalk@^4.1.0:
version "4.1.2"
Expand Down

0 comments on commit a4752c1

Please sign in to comment.