- set test workflow file to checkout and echo
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- and build and push step using drone plugin
This commit is contained in:
parent
9a89c74d9f
commit
c6b05337d7
61
.drone.yml
61
.drone.yml
@ -3,6 +3,8 @@ type: docker
|
|||||||
name: build
|
name: build
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
################################################################################################################################################
|
||||||
|
## example of running dind manually in drone
|
||||||
# - name: start-compose-container
|
# - name: start-compose-container
|
||||||
# image: gitea.bsidesolutions.net/bside-solutions/docker-compose-v2-alpine:latest
|
# image: gitea.bsidesolutions.net/bside-solutions/docker-compose-v2-alpine:latest
|
||||||
# environment:
|
# environment:
|
||||||
@ -24,24 +26,6 @@ steps:
|
|||||||
# - name: build
|
# - name: build
|
||||||
# image: docker
|
# image: docker
|
||||||
# environment:
|
# environment:
|
||||||
# SMTP_PROXY_EMAIL:
|
|
||||||
# from_secret: SMTP_PROXY_EMAIL
|
|
||||||
# SMTP_RECIPIENT_EMAIL:
|
|
||||||
# from_secret: SMTP_RECIPIENT_EMAIL
|
|
||||||
# SMTP_HOST:
|
|
||||||
# from_secret: SMTP_HOST
|
|
||||||
# SMTP_PORT:
|
|
||||||
# from_secret: SMTP_PORT
|
|
||||||
# SMTP_USERNAME:
|
|
||||||
# from_secret: SMTP_USERNAME
|
|
||||||
# SMTP_PASSWORD:
|
|
||||||
# from_secret: SMTP_PASSWORD
|
|
||||||
# NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK:
|
|
||||||
# from_secret: NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK
|
|
||||||
# RECAPTCHA_SECRET_KEY:
|
|
||||||
# from_secret: RECAPTCHA_SECRET_KEY
|
|
||||||
# NEXT_PUBLIC_RECAPTCHA_SITE_KEY:
|
|
||||||
# from_secret: NEXT_PUBLIC_RECAPTCHA_SITE_KEY
|
|
||||||
# REGISTRY_USER:
|
# REGISTRY_USER:
|
||||||
# from_secret: DOCKER_USERNAME
|
# from_secret: DOCKER_USERNAME
|
||||||
# REGISTRY_PASS:
|
# REGISTRY_PASS:
|
||||||
@ -56,12 +40,12 @@ steps:
|
|||||||
# # - docker exec --env-file .env.drone compose-container mkdir /home/node/app
|
# # - docker exec --env-file .env.drone compose-container mkdir /home/node/app
|
||||||
# # - docker cp . compose-container:/home/node/app
|
# # - docker cp . compose-container:/home/node/app
|
||||||
# # - docker exec -w /home/node/app --env-file .env.drone compose-container ls # check current directory
|
# # - docker exec -w /home/node/app --env-file .env.drone compose-container ls # check current directory
|
||||||
# - docker build -t gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:${DRONE_COMMIT_SHA:0:7} .
|
# - docker build -t gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:${DRONE_COMMIT_SHA:0:7} .
|
||||||
|
|
||||||
# - docker tag gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:${DRONE_COMMIT_SHA:0:7}
|
# - docker tag gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:${DRONE_COMMIT_SHA:0:7}
|
||||||
# - docker tag gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:latest
|
# - docker tag gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:latest
|
||||||
|
################################################################################################################################################
|
||||||
|
|
||||||
- name: docker-build
|
- name: build-and-push-image
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
username:
|
username:
|
||||||
@ -77,41 +61,6 @@ steps:
|
|||||||
- ${DRONE_COMMIT_SHA:0:7}
|
- ${DRONE_COMMIT_SHA:0:7}
|
||||||
|
|
||||||
|
|
||||||
- name: push-image
|
|
||||||
image: docker
|
|
||||||
environment:
|
|
||||||
SMTP_PROXY_EMAIL:
|
|
||||||
from_secret: SMTP_PROXY_EMAIL
|
|
||||||
SMTP_RECIPIENT_EMAIL:
|
|
||||||
from_secret: SMTP_RECIPIENT_EMAIL
|
|
||||||
SMTP_HOST:
|
|
||||||
from_secret: SMTP_HOST
|
|
||||||
SMTP_PORT:
|
|
||||||
from_secret: SMTP_PORT
|
|
||||||
SMTP_USERNAME:
|
|
||||||
from_secret: SMTP_USERNAME
|
|
||||||
SMTP_PASSWORD:
|
|
||||||
from_secret: SMTP_PASSWORD
|
|
||||||
NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK:
|
|
||||||
from_secret: NEXT_PUBLIC_GOOGLE_APPOINTMENTS_LINK
|
|
||||||
RECAPTCHA_SECRET_KEY:
|
|
||||||
from_secret: RECAPTCHA_SECRET_KEY
|
|
||||||
NEXT_PUBLIC_RECAPTCHA_SITE_KEY:
|
|
||||||
from_secret: NEXT_PUBLIC_RECAPTCHA_SITE_KEY
|
|
||||||
REGISTRY_USER:
|
|
||||||
from_secret: DOCKER_USERNAME
|
|
||||||
REGISTRY_PASS:
|
|
||||||
from_secret: DOCKER_PASSWORD
|
|
||||||
volumes:
|
|
||||||
- name: docker_sock
|
|
||||||
path: /var/run/docker.sock
|
|
||||||
commands:
|
|
||||||
- export DRONE_SHA=${DRONE_COMMIT_SHA:0:7}
|
|
||||||
- docker login gitea.bsidesolutions.net --username $REGISTRY_USER --password $REGISTRY_PASS
|
|
||||||
- docker push gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:${DRONE_COMMIT_SHA:0:7}
|
|
||||||
- docker push gitea.bsidesolutions.net/oonyeje/oonyeje-portfolio:latest
|
|
||||||
# - docker container stop compose-container
|
|
||||||
|
|
||||||
# - name: deploy-staging
|
# - name: deploy-staging
|
||||||
# image: plugins/ansible:latest
|
# image: plugins/ansible:latest
|
||||||
# settings:
|
# settings:
|
||||||
|
|||||||
@ -4,14 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- Setup-Basic-Website
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
- Setup-Basic-Website
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
@ -27,60 +25,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.TOKEN }}" | docker login ${{ gitea.server_url }} --username ${{ gitea.actor }} --password-stdin
|
echo "${{ secrets.TOKEN }}" | docker login ${{ gitea.server_url }} --username ${{ gitea.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Test workflow
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
# - name: Build and push Docker image (from docker-compose)
|
|
||||||
# id: docker_build
|
|
||||||
# uses: docker/build-push-action@v5
|
|
||||||
# with:
|
|
||||||
# provenance: false
|
|
||||||
# context: .
|
|
||||||
# file: ./Dockerfile # Ensure your Dockerfile is correctly referenced from your compose file.
|
|
||||||
# push: true
|
|
||||||
# tags: gitea.bsidesolutions.net/${{ gitea.repository }}:${{ gitea.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: Build Docker Image
|
|
||||||
run: docker build -t gitea.bsidesolutions.net/${{ gitea.repository }}:${{ gitea.sha }} .
|
|
||||||
|
|
||||||
- name: Push Docker Image (Commit)
|
|
||||||
run: docker push gitea.bsidesolutions.net/${{ gitea.repository }}:${{ gitea.sha }}
|
|
||||||
|
|
||||||
- name: Push Latest Docker Image (Optional)
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
run: docker push gitea.bsidesolutions.net/${{ gitea.repository }}:latest
|
|
||||||
|
|
||||||
# - name: Push latest tag (optional)
|
|
||||||
# if: github.ref == 'refs/heads/main'
|
|
||||||
# uses: docker/build-push-action@v5
|
|
||||||
# with:
|
|
||||||
# provenance: false
|
|
||||||
# context: .
|
|
||||||
# file: ./Dockerfile
|
|
||||||
# push: true
|
|
||||||
# tags: gitea.bsidesolutions.net/${{ 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: |
|
run: |
|
||||||
echo "Image pushed: ${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.sha }}"
|
echo "Image pushed: ${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.sha }}"
|
||||||
echo "Image pushed: ${{ gitea.server_url }}/${{ gitea.repository }}:latest"
|
echo "Image pushed: ${{ gitea.server_url }}/${{ gitea.repository }}:latest"
|
||||||
Loading…
x
Reference in New Issue
Block a user