Compare commits
8 commits
Author | SHA1 | Date | |
---|---|---|---|
31d42c8bbb | |||
022935f14c | |||
123fce455b | |||
e372802a15 | |||
|
d7841543cf | ||
|
2e99463306 | ||
|
8c00fc9c80 | ||
|
f1cf5da3bc |
3 changed files with 11 additions and 9 deletions
|
@ -6,10 +6,11 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
# Secrets you have to set up for this to work:
|
# Secrets you have to set up for this to work:
|
||||||
|
# REPO_DOMAIN: The domain of your gitea instance (eg. https://git.cool.dev)
|
||||||
# REPO_TOKEN: A gitea access token for the repo
|
# REPO_TOKEN: A gitea access token for the repo
|
||||||
# REGISTRY_USERNAME/PASSWORD: The username and password for the docker registry of choice
|
# REGISTRY_USERNAME/PASSWORD: The username and password for the docker registry of choice
|
||||||
env:
|
env:
|
||||||
DOCKER_REPO: git.jo-dev.xyz/jo
|
DOCKER_REPO: ${{ secrets.REPO_DOMAIN }}/jo
|
||||||
DOCKER_TAG: latest
|
DOCKER_TAG: latest
|
||||||
GITEA_REPO: jo/expresstemplate
|
GITEA_REPO: jo/expresstemplate
|
||||||
GITEA_TOKEN: ${{ secrets.REPO_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||||
|
@ -36,21 +37,19 @@ jobs:
|
||||||
- name: Login to Docker registry
|
- name: Login to Docker registry
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: git.jo-dev.xyz
|
registry: ${{ secrets.REPO_DOMAIN }}
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t ${DOCKER_REPO}:${DOCKER_TAG} .
|
docker build -t ${DOCKER_REPO}:${DOCKER_TAG} .
|
||||||
docker tag ${DOCKER_REPO}:${DOCKER_TAG} git.jo-dev.xyz/${GITEA_REPO}:${DOCKER_TAG}
|
docker tag ${DOCKER_REPO}:${DOCKER_TAG} ${{ secrets.REPO_DOMAIN }}/${GITEA_REPO}:${DOCKER_TAG}
|
||||||
|
|
||||||
- name: Push Docker image to Gitea package
|
- name: Push Docker image to Gitea package
|
||||||
run: |
|
run: |
|
||||||
docker push git.jo-dev.xyz/${GITEA_REPO}:${DOCKER_TAG}
|
docker push ${{ secrets.REPO_DOMAIN }}/${GITEA_REPO}:${DOCKER_TAG}
|
||||||
curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
curl -X POST -H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"tag_name": "'"${DOCKER_TAG}"'"}' \
|
-d '{"tag_name": "'"${DOCKER_TAG}"'"}' \
|
||||||
-d '{"name": "'"${CURRENT_DATE}"'"}' \
|
https://${{ secrets.REPO_DOMAIN }}/api/v1/repos/${GITEA_REPO}/releases
|
||||||
-d '{"prerelease": false}' \
|
|
||||||
https://git.jo-dev.xyz/api/v1/repos/${GITEA_REPO}/releases
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -4,3 +4,6 @@ node_modules
|
||||||
# Config files
|
# Config files
|
||||||
config/config.json
|
config/config.json
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
docker-compose.yml
|
|
@ -2,7 +2,7 @@ const express = require("express");
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
router.get("/", (req, res) => {
|
router.get("/", (req, res) => {
|
||||||
// API stuff goes here
|
// API stuff goes here :3
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
Loading…
Reference in a new issue