forked from alephdata/aleph
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3806dd9
commit ea17340
Showing
3 changed files
with
109 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,85 @@ | ||
name: Build UI | ||
name: Build aleph ui | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
paths-ignore: | ||
- "aleph/**" | ||
- "contrib/**" | ||
- "helm/**" | ||
- "mappings/**" | ||
- "site/**" | ||
- "docs/**" | ||
- "requirements.txt" | ||
- "requirements-dev.txt" | ||
paths: | ||
- aleph-ui/* | ||
- .github/workflows/aleph-ui.yml | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
docker-base: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/investigativedata/aleph-ui-base | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
type=sha | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
install: true | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push release | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Setup | ||
run: echo "ALEPH_SECRET=batman\n" >> aleph.env | ||
|
||
- name: Build development image | ||
run: | | ||
docker build -t ghcr.io/alephdata/aleph-ui:${GITHUB_SHA} ui | ||
docker tag ghcr.io/alephdata/aleph-ui:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui:latest | ||
- name: Check code formatting | ||
run: make format-check-ui | ||
|
||
- name: Run linter | ||
run: make lint-ui | ||
|
||
- name: Run tests | ||
run: make test-ui | ||
|
||
- name: Build production image | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
run: docker build -t ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA} -f ui/Dockerfile.production ui | ||
|
||
- name: Push docker image (tagged) | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin | ||
export ALEPH_TAG=${GITHUB_REF/refs\/tags\//} | ||
docker tag ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG}; | ||
docker push ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG}; | ||
- name: Tag latest image | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/test-') | ||
run: | | ||
docker tag ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui-production:latest; | ||
docker push ghcr.io/alephdata/aleph-ui-production:latest; | ||
docker: | ||
needs: docker-base | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ghcr.io/investigativedata/aleph-ui | ||
tags: | | ||
type=ref,event=branch | ||
type=semver,pattern={{version}} | ||
type=sha | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
install: true | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push release | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./aleph-ui | ||
build-args: | | ||
ALEPH_TAG=${{ version }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.