Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into feature/partners
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci-dev.yml
#	.github/workflows/ci-prod.yml
#	Dockerfile
#	nuxt.config.ts
  • Loading branch information
ninedev-i committed Jul 10, 2024
2 parents dc10020 + 38edd0f commit 13aa790
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 30 deletions.
41 changes: 29 additions & 12 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,46 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Extract branch variable
- name: Extract branch variable
run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
-
name: Extract revision variable

- name: Extract revision variable
run: echo "GIT_REVISION=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
-
name: Set up QEMU

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to GHCR as ${{ github.actor }}

- name: Login to GHCR as ${{ github.actor }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push

# Required to mount the Github Workspace to a volume
- name: Checkout
uses: actions/checkout@v4

- name: Build static content
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
image: ghcr.io/wirenboard/website-base-image:initial
options: -v ${{ github.workspace }}:/var/www
run: |
cd /var/www
pnpm install
pnpm run build
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,arm64
tags: |
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,29 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push
# Required to mount the Github Workspace to a volume
- name: Checkout
uses: actions/checkout@v4

- name: Build static content
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
image: ghcr.io/wirenboard/website-base-image:initial
options: -v ${{ github.workspace }}:/var/www
run: |
cd /var/www
pnpm install
pnpm run build
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64
platforms: linux/amd64,arm64
tags: |
ghcr.io/wirenboard/website:${{ env.BRANCH }}-${{ env.GIT_REVISION }}
ghcr.io/wirenboard/website:${{ env.BRANCH }}
Expand Down
18 changes: 3 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
FROM nginx

WORKDIR /var/www
# Not really useful outside GitHub Actions - actual builds happens there,
# Dockerfile just copies the output to various flavors of Nginx image

RUN apt-get update

RUN apt-get install -y \
npm

RUN npm install -g pnpm

COPY . /var/www

RUN pnpm install

RUN pnpm run build

RUN cp -r /var/www/.output/public/* /usr/share/nginx/html
COPY .output/public/ /usr/share/nginx/html/
4 changes: 3 additions & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ export default defineNuxtConfig({
routes: [
'/',
'/jobs',
'/ru/jobs',
'/en/jobs',
'/partners/software',
'/ru/partners/software',
'/en/partners/software',
Expand Down Expand Up @@ -52,4 +54,4 @@ export default defineNuxtConfig({
unstyled: true
}
}
})
})

0 comments on commit 13aa790

Please sign in to comment.