- add gitea actions pipeline
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4858c9707d
commit
5f773b1b11
10
.env.dev
Normal file
10
.env.dev
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
SMTP_PROXY_EMAIL=$SMTP_PROXY_EMAIL
|
||||||
|
SMTP_RECIPIENT_EMAIL=$SMTP_RECIPIENT_EMAIL
|
||||||
|
SMTP_HOST=$SMTP_HOST
|
||||||
|
SMTP_PORT=$SMTP_PORT
|
||||||
|
SMTP_USERNAME=$SMTP_USERNAME
|
||||||
|
SMTP_PASSWORD=$SMTP_PASSWORD
|
||||||
|
NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK=$NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK
|
||||||
|
RECAPTCHA_SECRET_KEY=$RECAPTCHA_SECRET_KEY
|
||||||
|
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=$NEXT_PUBLIC_RECAPTCHA_SITE_KEY
|
||||||
|
GIT_SHA=$GIT_SHA
|
||||||
66
.gitea/workflows/test.yaml
Normal file
66
.gitea/workflows/test.yaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
name: Build and Push Docker Image to Gitea Registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Login to Gitea Registry
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.GITEA_TOKEN }}" | docker login ${{ gitea.server_url }}/packages/container --username ${{ gitea.actor }} --password-stdin
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Build and push Docker image (from docker-compose)
|
||||||
|
id: docker_build
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile # Ensure your Dockerfile is correctly referenced from your compose file.
|
||||||
|
push: true
|
||||||
|
tags: ${{ gitea.server_url }}/packages/container/${{ gitea.repository }}:${{ github.sha }}
|
||||||
|
build-args: |
|
||||||
|
SMTP_PROXY_EMAIL=${{secrets.SMTP_PROXY_EMAIL}}
|
||||||
|
SMTP_RECIPIENT_EMAIL=${{secrets.SMTP_RECIPIENT_EMAIL}}
|
||||||
|
SMTP_HOST=${{secrets.SMTP_HOST}}
|
||||||
|
SMTP_PORT=${{secrets.SMTP_PORT}}
|
||||||
|
SMTP_USERNAME=${{secrets.SMTP_USERNAME}}
|
||||||
|
SMTP_PASSWORD=${{secrets.SMTP_PASSWORD}}
|
||||||
|
NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK=${{secrets.NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK}}
|
||||||
|
RECAPTCHA_SECRET_KEY=${{secrets.RECAPTCHA_SECRET_KEY}}
|
||||||
|
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=${{secrets.NEXT_PUBLIC_RECAPTCHA_SITE_KEY}}
|
||||||
|
|
||||||
|
- name: Push latest tag (optional)
|
||||||
|
if: github.ref == 'refs/heads/main'
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ gitea.server_url }}/packages/container/${{ gitea.repository }}:latest
|
||||||
|
build-args: |
|
||||||
|
SMTP_PROXY_EMAIL=${{secrets.SMTP_PROXY_EMAIL}}
|
||||||
|
SMTP_RECIPIENT_EMAIL=${{secrets.SMTP_RECIPIENT_EMAIL}}
|
||||||
|
SMTP_HOST=${{secrets.SMTP_HOST}}
|
||||||
|
SMTP_PORT=${{secrets.SMTP_PORT}}
|
||||||
|
SMTP_USERNAME=${{secrets.SMTP_USERNAME}}
|
||||||
|
SMTP_PASSWORD=${{secrets.SMTP_PASSWORD}}
|
||||||
|
NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK=${{secrets.NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK}}
|
||||||
|
RECAPTCHA_SECRET_KEY=${{secrets.RECAPTCHA_SECRET_KEY}}
|
||||||
|
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=${{secrets.NEXT_PUBLIC_RECAPTCHA_SITE_KEY}}
|
||||||
|
|
||||||
|
- name: Display Image details
|
||||||
|
run: |
|
||||||
|
echo "Image pushed: ${{ gitea.server_url }}/packages/container/${{ gitea.repository }}:${{ github.sha }}"
|
||||||
|
echo "Image pushed: ${{ gitea.server_url }}/packages/container/${{ gitea.repository }}:latest"
|
||||||
27
docker-compose.dev.yaml
Executable file
27
docker-compose.dev.yaml
Executable file
@ -0,0 +1,27 @@
|
|||||||
|
name: oonyeje-portfolio
|
||||||
|
services:
|
||||||
|
oonyeje-portfolio:
|
||||||
|
# this is not tagging corectly in drone, which is not pushing the correct build in the end
|
||||||
|
image: gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
ports:
|
||||||
|
- "6000:3000"
|
||||||
|
volumes:
|
||||||
|
- .:/home/node/app
|
||||||
|
- ./node_modules:/home/node/app/node_modules
|
||||||
|
environment:
|
||||||
|
- SMTP_PROXY_EMAIL=${SMTP_PROXY_EMAIL}
|
||||||
|
- SMTP_RECIPIENT_EMAIL=${SMTP_RECIPIENT_EMAIL}
|
||||||
|
- SMTP_HOST=${SMTP_HOST}
|
||||||
|
- SMTP_PORT=${SMTP_PORT}
|
||||||
|
- SMTP_USERNAME=${SMTP_USERNAME}
|
||||||
|
- SMTP_PASSWORD=${SMTP_PASSWORD}
|
||||||
|
- NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK=${NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK}
|
||||||
|
- RECAPTCHA_SECRET_KEY=${RECAPTCHA_SECRET_KEY}
|
||||||
|
- NEXT_PUBLIC_RECAPTCHA_SITE_KEY=${NEXT_PUBLIC_RECAPTCHA_SITE_KEY}
|
||||||
|
working_dir: /home/node/app/
|
||||||
|
command: sh -c "yarn install && yarn dev"
|
||||||
|
env_file:
|
||||||
|
- .env.dev
|
||||||
@ -1,7 +1,8 @@
|
|||||||
name: oonyeje-portfolio
|
name: oonyeje-portfolio
|
||||||
services:
|
services:
|
||||||
oonyeje-portfolio:
|
oonyeje-portfolio:
|
||||||
image: gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:"${DRONE_SHA}"
|
# this is not tagging corectly in drone, which is not pushing the correct build in the end
|
||||||
|
image: gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user