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
|
||||
|
||||
# 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
|
||||
# REGISTRY_USERNAME/PASSWORD: The username and password for the docker registry of choice
|
||||
env:
|
||||
DOCKER_REPO: git.jo-dev.xyz/jo
|
||||
DOCKER_REPO: ${{ secrets.REPO_DOMAIN }}/jo
|
||||
DOCKER_TAG: latest
|
||||
GITEA_REPO: jo/expresstemplate
|
||||
GITEA_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
|
@ -36,21 +37,19 @@ jobs:
|
|||
- name: Login to Docker registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
registry: git.jo-dev.xyz
|
||||
registry: ${{ secrets.REPO_DOMAIN }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
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
|
||||
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}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"tag_name": "'"${DOCKER_TAG}"'"}' \
|
||||
-d '{"name": "'"${CURRENT_DATE}"'"}' \
|
||||
-d '{"prerelease": false}' \
|
||||
https://git.jo-dev.xyz/api/v1/repos/${GITEA_REPO}/releases
|
||||
https://${{ secrets.REPO_DOMAIN }}/api/v1/repos/${GITEA_REPO}/releases
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -3,4 +3,7 @@ node_modules
|
|||
|
||||
# Config files
|
||||
config/config.json
|
||||
.env
|
||||
.env
|
||||
|
||||
# Docker
|
||||
docker-compose.yml
|
|
@ -2,7 +2,7 @@ const express = require("express");
|
|||
const router = express.Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
// API stuff goes here
|
||||
// API stuff goes here :3
|
||||
});
|
||||
|
||||
module.exports = router;
|
Loading…
Reference in a new issue