Skip to content

Bump actions/checkout from 3 to 4 #26

Bump actions/checkout from 3 to 4

Bump actions/checkout from 3 to 4 #26

Workflow file for this run

name: Docker
on:
push:
branches: ["master"]
pull_request:
types: [opened, reopened, synchronize]
branches: [master]
workflow_dispatch:
jobs:
build-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Build the Docker image
run: docker build --file Dockerfile --tag ${{ github.repository}}:$(git rev-parse --abbrev-ref HEAD | sed 's/[^a-zA-Z0-9]/-/g') .
publish-image:
runs-on: ubuntu-latest
needs: build-image
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Publish to registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: ${{ github.repository }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
# deploy-production:
# runs-on: ubuntu-latest
# needs: publish-image
# if: github.ref == 'refs/heads/master'
# environment: "production"
# steps:
# - name: Execute deployment on SSH
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# port: ${{ secrets.SSH_PORT }}
# script: ${{ secrets.SCRIPT }}
# deploy-dev:
# runs-on: ubuntu-latest
# if: github.ref != 'refs/heads/master'
# environment: "dev"
# steps:
# - name: Execute deployment on SSH
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# key: ${{ secrets.SSH_KEY }}
# port: ${{ secrets.SSH_PORT }}
# script: ${{ secrets.SCRIPT }} ${{ github.head_ref || github.ref_name }}