Skip to content

Commit

Permalink
Merge pull request #1 from ndc-dxc/main
Browse files Browse the repository at this point in the history
Docker image build and upload
  • Loading branch information
ndc-istat authored Aug 22, 2024
2 parents 725cded + ab31e61 commit fd6b20f
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docker Image CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
GITHUB_WORKFLOW: dati-semantic-wordpress
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
IMAGE="$REGISTRY/$IMAGE_NAME"
TAG="$(date +'%Y%m%d')-${{github.run_number}}-$(git rev-parse --short HEAD)"
docker build . --file Dockerfile --tag ${IMAGE}:${TAG}
deploy:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions:
contents: read
packages: write
needs:
- build
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: extract image
id: extractImage
run: |
IMAGE="$REGISTRY/$IMAGE_NAME"
TAG="$(date +'%Y%m%d')-${{github.run_number}}-$(git rev-parse --short HEAD)"
echo "##[set-output name=imageName;]${IMAGE}:${TAG}"
- uses: convictional/[email protected]
with:
owner: teamdigitale
repo: dati-semantic-kubernetes
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workflow_file_name: update-config.yaml
ref: dev
wait_interval: 20
inputs: '{"serviceName": "dati-semantic-wordpress", "imageWithNewTag": "${{ steps.extractImage.outputs.imageName }}"}'
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM wordpress:6.6.0-php8.3-apache

0 comments on commit fd6b20f

Please sign in to comment.