diff --git a/.github/workflows/docker_dev.yml b/.github/workflows/docker_dev.yml new file mode 100644 index 0000000..d68c643 --- /dev/null +++ b/.github/workflows/docker_dev.yml @@ -0,0 +1,41 @@ +name: Build Dev Docker + +on: + push: + branches-ignore: + - "renovate/**" + tags-ignore: + - "**" + +jobs: + build-docker: + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout + uses: actions/checkout@v3 + + - name: 🛠️ Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: 🔒 Login to ghcr.io + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: 🛠️ Get branch name + id: branch-name + uses: tj-actions/branch-names@v5.4 + + - name: 🛠️ Set tag + run: | + echo "tag=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV + + - name: 🔨 Build and push Docker + uses: docker/build-push-action@v3 + with: + push: true + context: . + tags: "ghcr.io/sebclem/claptrapbot-ui:${{ env.tag }}" + file: ./Dockerfile diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 12560e2..6b550ea 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,29 +5,21 @@ name: Node.js CI on: push: - branches: [ "main" ] + branches: ["main"] jobs: build: - runs-on: ubuntu-latest steps: - - name: ⬇️ Checkout - uses: actions/checkout@v3 - - name: ⚒️ Use Node.js 16.x - uses: actions/setup-node@v3 - with: - node-version: 16.x - cache: 'yarn' - - name: 🔨 Install dependencies - run: yarn install --immutable - - - name: 🔨 Build app - run: yarn build --mode staging - - # - name: 🚀 Deploy - # uses: JamesIves/github-pages-deploy-action@v4.3.3 - # with: - # branch: gh-pages - # folder: dist + - name: ⬇️ Checkout + uses: actions/checkout@v3 + - name: ⚒️ Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: "yarn" + - name: 🔨 Install dependencies + run: yarn install --immutable + - name: 🔨 Build app + run: yarn build --mode staging diff --git a/Dockerfile b/Dockerfile index b0bdcdb..1f257a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ WORKDIR /usr/share/nginx/html RUN rm -rf ./* # Copy static assets from builder stage COPY --from=builder /app/dist . -COPY nginx.conf /etc/nginx/conf.d/default.conf +COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf # Containers run nginx with global directives and daemon off ENTRYPOINT ["nginx", "-g", "daemon off;"] diff --git a/nginx.conf b/nginx/nginx.conf similarity index 100% rename from nginx.conf rename to nginx/nginx.conf diff --git a/package.json b/package.json index d0af045..1e6f73f 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,6 @@ }, "lint-staged": { "*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}": "eslint --cache --fix", - "*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts,css,scss,md}": "prettier --write" + "*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts,css,scss,md,yml,yaml,json}": "prettier --write" } }