Skip to content

Commit

Permalink
ci: deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cybersokari committed Dec 26, 2024
1 parent 3221e10 commit 1f0013b
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 84 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/deploy-docker-action.yaml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/deploy-docker.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
options:
- cli
- shared
default: cli
semver:
description: Bump version
required: true
Expand All @@ -17,13 +18,16 @@ on:
- patch
- minor
- major
default: patch

jobs:
deploy-cli:
if: ${{ github.event.inputs.job == 'cli' }}
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
token: '${{ secrets.PERSONAL_ACCESS_TOKEN }}'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -52,15 +56,17 @@ jobs:

- name: Notify Docker jobs
id: version-out
run: |
echo "version=${{steps.publish.outputs.version}}" >> $GITHUB_ENV
run: echo "::set-output name=version::${{ steps.publish.outputs.version}}"

- name: Add & Commit
uses: EndBug/[email protected]
with:
author_name: Bot
author_email: bot@github.com
author_name: Sokari
author_email: sokariharry@gmail.com
message: "Release packages/cli version ${{steps.publish.outputs.version}}"
add: 'packages/cli/*.json'
push: 'origin main --force'
tag: 'v${{steps.publish.outputs.version}} --force'

deploy-shared:
if: ${{ github.event.inputs.job == 'shared' }}
Expand Down Expand Up @@ -98,6 +104,7 @@ jobs:
author_name: Bot
author_email: [email protected]
message: "Release packages/shared version ${{steps.publish.outputs.version}}"
github_token: '${{ github.token }}'


deploy-docker-action:
Expand All @@ -115,10 +122,11 @@ jobs:
- name: Build and push
uses: docker/[email protected]
with:
context: .
context: ./packages/action
file: ./packages/action/action.Dockerfile
platforms: linux/amd64
push: true
build-args: CLI_VERSION=${{needs.deploy-cli.outputs.version}}
tags: |
sokari/allure-deployer-action:${{needs.deploy-cli.outputs.version}}
sokari/allure-deployer-action:${{ github.sha }}
Expand Down Expand Up @@ -147,10 +155,11 @@ jobs:
- name: Build and push
uses: docker/[email protected]
with:
context: .
context: ./packages/docker
file: ./packages/docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: CLI_VERSION=${{needs.deploy-cli.outputs.version}}
tags: |
sokari/allure-deployer:latest
sokari/allure-deployer:${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion config/act.npm.event.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"inputs": {
"job": "shared",
"job": "cli",
"semver": "patch"
}
}
4 changes: 2 additions & 2 deletions packages/action/action.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:20-alpine AS deps
LABEL authors="cybersokari"
RUN apk add openjdk17-jre
RUN apk add --no-cache openjdk17-jre
#RUN npm i -g allure #Allure V3

FROM deps AS prod

ENV CLI_VERSION=1.0.6
ARG CLI_VERSION=1.0.6
RUN npm i -g allure-deployer@$CLI_VERSION
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/.npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
src
version-update.cjs
version-update.cjs
tsconfig.json
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "allure-deployer",
"version": "1.0.6",
"version": "1.1.0",
"description": "Deploy your Allure Reports to Firebase, and notify in Slack, No server required",
"keywords": [
"allure server",
Expand Down Expand Up @@ -39,7 +39,7 @@
"ora": "^8.1.1"
},
"devDependencies": {
"@types/conf": "^3.0.3"
"typescript": "^4.9.0"
},
"bin": {
"allure-deployer": "dist/index.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ RUN apk add openjdk17-jre

FROM deps AS prod

ENV CLI_VERSION=1.0.6
ARG CLI_VERSION=1.0.6
RUN npm i -g allure-deployer@$CLI_VERSION
COPY packages/docker/start.sh /start.sh
COPY start.sh /start.sh
RUN chmod +x /start.sh

ENTRYPOINT ["/start.sh"]

0 comments on commit 1f0013b

Please sign in to comment.