nvim/.github/workflows/docker-image.yml

33 lines
796 B
YAML
Raw Normal View History

2023-03-03 20:09:40 +00:00
name: Docker Image CI
on:
push:
branches: [ "main" ]
2023-03-04 12:28:15 +00:00
schedule:
- cron: '30 4 * * 0,2,4'
2023-03-03 20:09:40 +00:00
jobs:
build:
runs-on: ubuntu-latest
2023-03-03 20:38:49 +00:00
permissions:
packages: write
contents: read
2023-03-03 20:09:40 +00:00
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
2023-03-04 12:28:15 +00:00
run: docker build . --file Dockerfile --tag neovim:latest
2023-03-03 20:38:49 +00:00
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push image
run: |
2023-03-04 12:28:15 +00:00
IMAGE_NAME="neovim"
2023-03-04 12:35:26 +00:00
IMAGE_ID="ghcr.io/szwendacz99/$IMAGE_NAME"
2023-03-04 12:28:15 +00:00
TAG=$(date +"%Y-%m-%d")
2023-03-04 12:35:26 +00:00
docker tag $IMAGE_NAME:latest $IMAGE_ID:latest
2023-03-04 12:28:15 +00:00
docker push $IMAGE_ID:latest
docker tag $IMAGE_ID:latest $IMAGE_ID:$TAG
2023-03-04 12:46:50 +00:00
docker push $IMAGE_ID:$TAG