|
@@ -6,9 +6,17 @@ on:
|
|
tags:
|
|
tags:
|
|
- 'v*'
|
|
- 'v*'
|
|
|
|
|
|
|
|
+env:
|
|
|
|
+ REGISTRY: ghcr.io
|
|
|
|
+ REGISTRY_USER: ${{ github.actor }}
|
|
|
|
+ REGISTRY_PASSWORD: ${{ github.token }}
|
|
|
|
+ IMAGE_NAME: ${{ github.repository }}
|
|
|
|
+
|
|
jobs:
|
|
jobs:
|
|
main:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
runs-on: ubuntu-latest
|
|
|
|
+ permissions:
|
|
|
|
+ packages: write
|
|
steps:
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
@@ -19,7 +27,7 @@ jobs:
|
|
|
|
|
|
- name: Install
|
|
- name: Install
|
|
run: |
|
|
run: |
|
|
- npm install
|
|
|
|
|
|
+ npm ci
|
|
npm run setheapsize
|
|
npm run setheapsize
|
|
|
|
|
|
- name: Lint
|
|
- name: Lint
|
|
@@ -31,17 +39,38 @@ jobs:
|
|
npm run testnodeconsumer
|
|
npm run testnodeconsumer
|
|
|
|
|
|
- name: Production Build
|
|
- name: Production Build
|
|
- if: success()
|
|
|
|
run: npx grunt prod
|
|
run: npx grunt prod
|
|
|
|
|
|
- name: UI Tests
|
|
- name: UI Tests
|
|
- if: success()
|
|
|
|
run: |
|
|
run: |
|
|
sudo apt-get install xvfb
|
|
sudo apt-get install xvfb
|
|
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
|
xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui
|
|
|
|
|
|
|
|
+ - name: Image Metadata
|
|
|
|
+ id: image-metadata
|
|
|
|
+ uses: docker/metadata-action@v4
|
|
|
|
+ with:
|
|
|
|
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
|
|
+ tags: |
|
|
|
|
+ type=semver,pattern={{major}}
|
|
|
|
+ type=semver,pattern={{major}}.{{minor}}
|
|
|
|
+ type=semver,pattern={{version}}
|
|
|
|
+
|
|
|
|
+ - name: Production Image Build
|
|
|
|
+ id: build-image
|
|
|
|
+ uses: redhat-actions/buildah-build@v2
|
|
|
|
+ with:
|
|
|
|
+ tags: ${{ steps.image-metadata.outputs.tags }}
|
|
|
|
+ labels: ${{ steps.image-metadata.outputs.labels }}
|
|
|
|
+ containerfiles: ./Dockerfile
|
|
|
|
+ platforms: linux/amd64
|
|
|
|
+ oci: true
|
|
|
|
+ # Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
|
|
|
|
+ extra-args: |
|
|
|
|
+ --ulimit nofile=10000
|
|
|
|
+
|
|
|
|
+
|
|
- name: Upload Release Assets
|
|
- name: Upload Release Assets
|
|
- if: success()
|
|
|
|
id: upload-release-assets
|
|
id: upload-release-assets
|
|
uses: svenstaro/upload-release-action@v2
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
with:
|
|
@@ -53,7 +82,14 @@ jobs:
|
|
body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details."
|
|
body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details."
|
|
|
|
|
|
- name: Publish to NPM
|
|
- name: Publish to NPM
|
|
- if: success()
|
|
|
|
uses: JS-DevTools/npm-publish@v1
|
|
uses: JS-DevTools/npm-publish@v1
|
|
with:
|
|
with:
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
|
|
+
|
|
|
|
+ - name: Publish to GHCR
|
|
|
|
+ uses: redhat-actions/push-to-registry@v2
|
|
|
|
+ with:
|
|
|
|
+ tags: ${{ steps.build-image.outputs.tags }}
|
|
|
|
+ registry: ${{ env.REGISTRY }}
|
|
|
|
+ username: ${{ env.REGISTRY_USER }}
|
|
|
|
+ password: ${{ env.REGISTRY_PASSWORD }}
|