Skip to content

Commit

Permalink
[workflows/ci-cd] Add CI/CD Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gnuion committed Aug 29, 2023
1 parent b53bbc9 commit 43880ac
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github
.nuxt
.git
node_modules
.gitignore
Dockerfile
50 changes: 50 additions & 0 deletions .github/workflows/ci-id.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI/CD

on:
pull_request:
branches:
- main
types:
- closed
- synchronize
- opened
workflow_dispatch:

env:
REGISTRY: docker.io
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set environment variables
run: |
TAG=${{ hashFiles('**/package-lock.json') }}
USER=$GITHUB_REPOSITORY_OWNER
BUILDER_STRING=${REGISTRY}/${GITHUB_REPOSITORY}:builder-${TAG}
CONTEXT="./"
# echo "BUILDER_STRING=$BUILDER_STRING" >> $GITHUB_ENV
echo "BUILDER_STRING=hello" >> $GITHUB_ENV
echo "USER=$USER >> $GITHUB_ENV"
echo "CONTEXT=$CONTEXT" >> $GITHUB_ENV
- name: Build builder image
run: |
echo $BUILDER_STRING
echo $USER
echo $CONTEXT
echo $(docker manifest inspect $BUILDER_STRING > /dev/null ; echo $?)
# if [ $() == 0 ]
# then
# exit 0x`x
# done
# docker login -u=$USER -p=${{ secrets.DOCKER_CI_TOKEN }} docker.io
# docker buildx create --use --driver=docker-container
# docker buildx build --push -t $BUILDER_STRING \
# --cache-from type=registry,ref=$BUILDER_STRING \
# --cache-to type=registry,ref=$BUILDER_STRING \
# ${CONTEXT}
# echo "Published image $BUILDER_STRING"
# docker logout

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM docker.io/node:18-alpine3.18
5 changes: 4 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
telemetry: {
enabled: false
},
devtools: { enabled: true },
devServer: {
host: "127.0.0.1",
host: "0.0.0.0",
},
vite: {
server: {
Expand Down

0 comments on commit 43880ac

Please sign in to comment.