Skip to content

Commit

Permalink
chore: remove unneeded lines and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Jun 10, 2024
1 parent 26b7299 commit 4e8aa14
Showing 1 changed file with 36 additions and 77 deletions.
113 changes: 36 additions & 77 deletions .github/workflows/copy-build-to-d2-ci.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,42 @@
name: Publish JavaScript Library
name: Copy build to d2-ci

on:
push:
branches-ignore:
- master
release:
types: [published]
push:
branches-ignore:
- master

env:
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: '[email protected]'
NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}}
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}}
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: '[email protected]'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: '[email protected]'
NPM_TOKEN: ${{secrets.DHIS2_BOT_NPM_TOKEN}}
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}}

jobs:
publish-to-github:
runs-on: ubuntu-latest
if: contains(github.ref, 'alpha')

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{env.GH_TOKEN}}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install --frozen-lockfile

- name: Build package
run: yarn build

- name: Pack and unpack the build
run: yarn pack --filename output.tgz && tar -xzf output.tgz

- name: Copy package to d2-ci
uses: dhis2/deploy-build@master
with:
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_CONFIG_REGISTRY: https://npm.pkg.github.com/










publish-to-npm:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Build package
run: npm run build

- name: Publish to npm
run: npm publish --registry=https://registry.npmjs.org
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
copy-to-d2-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{env.GH_TOKEN}}

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install dependencies
run: npm install --frozen-lockfile

- name: Build package
run: yarn build

- name: Pack and unpack the build
run: yarn pack --filename output.tgz && tar -xzf output.tgz

- name: Copy package to d2-ci
uses: dhis2/deploy-build@master
with:
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

0 comments on commit 4e8aa14

Please sign in to comment.