Docker Build Elastic Kibana and Logstash #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build Elastic Kibana and Logstash | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 2 * * 1' | |
env: | |
TZ: Asia/Shanghai | |
IMAGE_NAME: logstash | |
IMAGE_TAGS: "latest 7 8" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the Docker image | |
run: | | |
for tag in ${IMAGE_TAGS}; do | |
docker build . -f images/elastic/${tag}/Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/elastic:${tag} | |
docker build . -f images/kibana/${tag}/Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/kibana:${tag} | |
docker build . -f images/logstash/${tag}/Dockerfile -t ${{ vars.DOCKER_REGISTRY }}/dockenv/logstash:${tag} | |
done | |
- name: Login to Docker Registry | |
run: | | |
docker login -u ${{vars.USERNAME}} -p "${{ secrets.APIKEY }}" ${{ vars.DOCKER_REGISTRY }} | |
- name: Push Docker Image | |
run: | | |
for tag in ${IMAGE_TAGS}; do | |
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/elastic:${tag} | |
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/logstash:${tag} | |
docker push ${{ vars.DOCKER_REGISTRY }}/dockenv/kibana:${tag} | |
done |