Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/deploy-Docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# reference:
# 1. https://github.com/docker/build-push-action/blob/master/docs/advanced/push-multi-registries.md
# 2. https://github.com/docker/build-push-action/blob/master/docs/advanced/share-image-jobs.md
# 3. https://northflank.com/docs/v1/application/infrastructure-as-code/use-github-actions-with-northflank
# 4. https://github.com/northflank/deploy-to-northflank/issues/1#issuecomment-2629319799

name: Deploy Docker to Production environment
on:
push:
tags:
- v*
jobs:
deploy_docker_image:
name: Deploy Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v7

- name: Inject Environment variables
run: |
cat > .env.local <<EOF
${{ secrets.ENV_FILE }}
EOF
Comment on lines +22 to +26

- uses: docker/login-action@v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- uses: docker/metadata-action@v6.1.0
id: meta
with:
images: ghcr.io/${{ github.repository }}
Comment thread
TechQuery marked this conversation as resolved.
tags: |
type=ref,event=tag
type=raw,value=latest

- uses: docker/build-push-action@v7.2.0
id: push
with:
context: .
push: true
Comment on lines +42 to +46
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: deploy to NorthFlank
env:
PROJECT_ID: ${{ secrets.NORTHFLANK_PROJECT_ID }}
SERVICE_ID: ${{ secrets.NORTHFLANK_SERVICE_ID }}
run: |
curl --fail-with-body --show-error --request POST \
--header "Authorization: Bearer ${{ secrets.NORTHFLANK_API_KEY }}" \
--header "Content-Type: application/json" \
--data '{"docker":{"configType":"default"},"external":{"credentials":"${{ secrets.NORTHFLANK_EXTERNAL_CREDENTIALS }}","imagePath":"ghcr.io/${{ github.repository }}:latest"}}' \
https://api.northflank.com/v1/projects/$PROJECT_ID/services/$SERVICE_ID/deployment
5 changes: 3 additions & 2 deletions pages/NGO/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ import { ZodiacBar } from 'idea-react';
import { PageHead } from '../../components/Layout/PageHead';
import { OrganizationModel } from '../../models/Organization';
import { I18nContext } from '../../models/Translation';
import { skipBuilding } from '../api/SSG';

export const getStaticProps = async () => {
export const getStaticProps = skipBuilding(async () => {
const organizationStore = new OrganizationModel();

const [startYear, endYear] = await organizationStore.getYearRange();

return { props: { startYear, endYear } };
};
});
Comment thread
TechQuery marked this conversation as resolved.

const OrganizationHomePage: FC<InferGetStaticPropsType<typeof getStaticProps>> = observer(props => {
const { t } = useContext(I18nContext);
Expand Down
Loading