diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..0647a10 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,37 @@ +name: Deployment + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + deploy-site: + name: 'deploy' + env: + REGISTRY_USERNAME: nicholas + IMAGE_REGISTRY: git.uuard.com + IMAGE_NAME: nicholas/personal-website + IMAGE_TAG: latest + runs-on: ubuntu-latest + steps: + - name: โฌ‡๏ธ Checkout repo + uses: actions/checkout@v4 + + - name: ๐Ÿ” Gitea Registry Login + uses: docker/login-action@v3 + with: + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ env.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} + + - name: ๐Ÿ‹ Build Docker image + run: docker build -t $IMAGE_REGISTRY/$IMAGE_NAME:$IMAGE_TAG ./container + + - name: ๐Ÿš€ Push Docker image + run: docker push $IMAGE_REGISTRY/$IMAGE_NAME:$IMAGE_TAG + + - name: ๐Ÿงน Prune images + if: always() + run: docker image prune -f diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 79877e3..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,27 +0,0 @@ -pipeline { - agent any - environment { - DEPLOY_DIR = '/mnt/jenkins_deployments/personal-website' - } - stages { - stage('Checkout') { - steps { - checkout scm - } - } - stage('copy to nginx server') { - steps { - sh """ - rm -rf ${DEPLOY_DIR}/* - cp -r ${WORKSPACE}/* ${DEPLOY_DIR}/ - chmod -R 755 ${DEPLOY_DIR} - """ - } - } - } - post { - failure { - echo "Build Failed" - } - } -} \ No newline at end of file diff --git a/container/Dockerfile b/container/Dockerfile new file mode 100644 index 0000000..b081052 --- /dev/null +++ b/container/Dockerfile @@ -0,0 +1,7 @@ +FROM nginx:alpine + +RUN rm -rf /usr/share/nginx/html/* + +COPY site/ /usr/share/nginx/html/ + +EXPOSE 80 diff --git a/apple-touch-icon.png b/container/site/apple-touch-icon.png similarity index 100% rename from apple-touch-icon.png rename to container/site/apple-touch-icon.png diff --git a/assets/css/styles.css b/container/site/assets/css/styles.css similarity index 100% rename from assets/css/styles.css rename to container/site/assets/css/styles.css diff --git a/assets/images/profile-image-ghibli.png b/container/site/assets/images/profile-image-ghibli.png similarity index 100% rename from assets/images/profile-image-ghibli.png rename to container/site/assets/images/profile-image-ghibli.png diff --git a/favicon-96x96.png b/container/site/favicon-96x96.png similarity index 100% rename from favicon-96x96.png rename to container/site/favicon-96x96.png diff --git a/favicon.ico b/container/site/favicon.ico similarity index 100% rename from favicon.ico rename to container/site/favicon.ico diff --git a/favicon.svg b/container/site/favicon.svg similarity index 100% rename from favicon.svg rename to container/site/favicon.svg diff --git a/index.html b/container/site/index.html similarity index 100% rename from index.html rename to container/site/index.html diff --git a/site.webmanifest b/container/site/site.webmanifest similarity index 100% rename from site.webmanifest rename to container/site/site.webmanifest diff --git a/web-app-manifest-192x192.png b/container/site/web-app-manifest-192x192.png similarity index 100% rename from web-app-manifest-192x192.png rename to container/site/web-app-manifest-192x192.png diff --git a/web-app-manifest-512x512.png b/container/site/web-app-manifest-512x512.png similarity index 100% rename from web-app-manifest-512x512.png rename to container/site/web-app-manifest-512x512.png