[workflows] rename .gitea to .forgejo, modify .gitignore
This commit is contained in:
parent
123fce455b
commit
022935f14c
2 changed files with 4 additions and 1 deletions
55
.forgejo/workflows/build.yml
Normal file
55
.forgejo/workflows/build.yml
Normal file
|
@ -0,0 +1,55 @@
|
|||
name: Build and push Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 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: ${{ secrets.REPO_DOMAIN }}/jo
|
||||
DOCKER_TAG: latest
|
||||
GITEA_REPO: jo/expresstemplate
|
||||
GITEA_TOKEN: ${{ secrets.REPO_TOKEN }}
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set current date and time
|
||||
run: echo "CURRENT_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Docker
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get -y install apt-transport-https ca-certificates curl gnupg lsb-release
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
|
||||
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
apt-get update
|
||||
apt-get -y install docker-ce docker-ce-cli containerd.io
|
||||
|
||||
- name: Login to Docker registry
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
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} ${{ secrets.REPO_DOMAIN }}/${GITEA_REPO}:${DOCKER_TAG}
|
||||
|
||||
- name: Push Docker image to Gitea package
|
||||
run: |
|
||||
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}"'"}' \
|
||||
https://${{ secrets.REPO_DOMAIN }}/api/v1/repos/${GITEA_REPO}/releases
|
Loading…
Add table
Add a link
Reference in a new issue